My app is built on Laravel 8.x and deployed via Vapor and uses Redis as session driver.
I noticed this odd behaviour, where if you login and copy the cookie and then logout and import the cookie and refresh the page, you are logged back in.
Here are the steps to re-produce:
- Install the Cookie-Editor plugin in chrome
- Login to the app
- Use the cookie-editor plugin and export the cookie
- Logout of the app
- Use cookie-editor plugin to import the exported cookie and refresh the page, you are now logged in
I followed the instructions on https://laravel.com/docs/8.x/authentication#logging-out to implement the logout functionality, but this doesn't seem to be working?
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
I am not able to re-produce this with the app running locally in Apache + PHP, this behaviour is only observed on my vapor deployed instance?
Any idea what the issue might be? How do you properly logout, so that cookie from previous session can't be used again?