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

VinceMukiiri's avatar

Persist session across parent domain and sub-domains?

I'm trying to persist a login session such that the user goes to example.com/login and once they are logged in they are redirected to foo.example.com. Problem is foo.example.com doesn't have the logged in session. I've tried changing the session domain like so 'domain' => '.example.com' but it doesn't work. I suspect this only allows sessions to be shared across sub-domains but not the parent domain.

0 likes
0 replies

Please or to participate in this conversation.