Did you try $request->session()->flush();?
Jul 25, 2016
14
Level 2
How to delete all session data, so that users must re-log in?
Hi everybody, I'm trying to figure out how to require all users to sign in when they visit my app again. Basically, remove the session data that keeps them logged in, so that they have to re-log in. I'm fine with removing all session data, but I can't figure out how to do this.
I've tried 3 things so far:
- Rebooting the server (thinking this may clear out any data stored in memory).
- Deleting all the files in the
storage/frameworks/sessionsdirectory. - Removing the data in the
remember_tokenfield of theuserstable.
However, NOTHING seems to be working, and the users are still logged in when the browser is re-opened!! :/
Here's my config/session.php:
<?php
return [
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 1,
'expire_on_close' => true,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => null,
'secure' => false,
];
HELP!!
Please or to participate in this conversation.