Quantcast
Channel: Multiple session cookies created for the same Laravel app - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by lesssugar for Multiple session cookies created for the same Laravel app

$
0
0

To anyone having a similar problem: we solved it actually easily after we realized we could specify the session cookie name ourselves, per (sub)domain.

So, we adjusted the config/session.php cookie key:

'cookie' => env('SESSION_COOKIE_NAME', 'laravel_session')

and then we set the SESSION_COOKIE_NAME variable in respective .env files, like this:

# subdomainA.example.com
SESSION_COOKIE_NAME=subdomainA_session

or

# subdomainB.example.com
SESSION_COOKIE_NAME=subdomainB_session

etc.

Hope this helps.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>