Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jonnybarnes's avatar

Laravel Dusk tests on Travis CI doesn’t persist session data across redirects

I have a dusk test, where I have a page, there’s a link, when clicked we go to a second page. Here a value is generated server-side and added to the session, then we are redirected to the first page, and that page will now contain the value generated ,because that value is retreived from the session and passed to the view.

By editing the controller method for the second page I know that when the test is run on travis the value is generated correctly.

Therefore the value isn’t being persisted in the session beyond the redirect.

Does anyone know how to acheived this desired behaviour on travis.

0 likes
2 replies
squibby's avatar

@jonnybarnes was this solved by updating the http_only parameter in the session.php config file or something else? I am having a similar issue with this on Travis CI...... Thanks.

Please or to participate in this conversation.