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

Ceedbox's avatar

Laravel Subdomain Session Persistence and Routing Problems

So I have a problem, once logged in I want the user to be redirected to a subdomain version where the dashboard is. However the login session isn't persisting. This is my .env variables related to session

SESSION_DOMAIN=.localhost
SESSION_DRIVER=database
SESSION_LIFETIME=120

Also, when the login is successfull and it redirects to dashboard.localhost it doesn't see the user as authenticated and then goes to localhost/auth/login and it loads the login form.

0 likes
1 reply
Ceedbox's avatar

Resolved the issue, I had a Middleware enabled that was causing a the session to be reset each time

Please or to participate in this conversation.