Quantcast
Viewing latest article 1
Browse Latest Browse All 3

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

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 latest article 1
Browse Latest Browse All 3

Trending Articles