Reputation: 12601
Every time I reload the page, I get a new value out of session()->getId()
.
Some have suggested adding the laravel_session
to the unencrypted cookie exception, but this does not fix it and is not a viable option anyway.
The issue persists no matter which session storage method I use. File, redis, etc all have the same problem.
This is happening on a fresh install of Laravel 7.
Contents of .env:
SESSION_DRIVER=redis
SESSION_LIFETIME=1440
SESSION_DOMAIN=example.test
What's causing this?
Upvotes: 1
Views: 2652
Reputation: 2393
That means:
For case 1 make sure StartSession
middleware exists in app/Kernel.php
at $middlewareGroups
-> web
For case 3 check this answer. In case your app relies on a single domain/path, I recommend you to remove SESSION_DOMAIN
.
Finally, manually remove all sessions from your session driver, then run php artisan config:cache
and try again.
Upvotes: 1