I get the error The page has expired due to inactivity. Please refresh and try again. on a Laravel 5.6.39. In Chrome "Network tab" says error login - 419 unknown status
As soon as I refresh the page, I immediately get the error. So I never see the login view anymore, then I'm stuck. Think to common users that have no experience and only try to refresh the page. If it doesn't work they leave your app.
I can reproduce the error following these steps:
- go to login view
- enter username and password and don't check "remember me" flag
- wait that session expires (for test purpose I set
SESSION_LIFETIMEto 1 minute) - hit Login button and I get that error
I already read and tried the most common causes:
@csrfis present in the login form (it's the default authentication by Laravel)- the folder
storagehas755but tried also with775and777 - tried to launch
php artisan cache:clearphp artisan config:clearphp artisan route:clearphp artisan view:clearphp artisan config:cachephp artisan key:generate - I'm using the default
SESSION_DRIVER=filebut in production I also tried to replace it withSESSION_DRIVER=cookiewithSESSION_DOMAIN=https://app.my-domain.com/
Here you'll find my code (controllers, view, routes, .env, ...): https://gist.github.com/dangelion/aa7fc54ea75f7b2d6062fc79f07e04e8
I really have no more idea to solve this. Some helps? Thanks