Support the ongoing development of →
Authentication Session Testing
Last updated 1 year ago.

Hi Martin,

Although this is a delayed response, hopefully it can partially help others.

Using the "Auth::login" or "Auth::loginUsingId" is not going to help - as that's logging in via the command line part of behat, whereas the broswer side (I imagine you're using Mink or something?) does not get that session data, so it is not logged in for that part.

I'm still trying to figure out how it can be done, but will let you know if I find out.

Last updated 1 year ago.


I wrote an article on how to set up the php testing framework Behat in order to use it with the Laravel framework in a Homestead development environment. It mentions the problems one faces when testing authentication in a testing environment.

I hope this helps.

Last updated 1 year ago.


I just blogged about how to share set a session when using a separate server with Behat. The approach can be used with Homestead, Artisan Serve or any other separate server.

It involves passing the session cookie to the Goutte or Selenium session.


Last updated 9 years ago.

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.