I had tried using 'cookie', 'database', 'file' and all my sessions just randomly get expired. Any idea why this happen?
I had similar problem with sessions, you might want to check this out
5.2 - Weird session behaviour with routes in web middleware group
"However since 5.2.27 all routes are registered in the web middleware group by default"
So, if your routes are wrapped with 'web' middleware
Route::group(['middleware' => ['web']], function() {
...
});
remove that and see if it helps.
That helped me
Edit: To see which version of Laravel you have, run
php artisan --version
To check if middleware is loaded twice, run
php artisan route:list
I had tried add or remove the routes from web middleware, both still have same issue with random expired sessions. I can confirm that there is no duplicate middleware running through route:list.
Somehow I do not know why the problem suddenly gone itself without any more settings after two days. Not sure it will come back in the future or not.
Make sure U don't do a "die and dump" on session variable, for debugging purposes, as I did. :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community