I am trying to store session in the database rather than in file. So in my .env file:-
SESSION_DRIVER=database
& in my config/session.php:-
'driver' => env('SESSION_DRIVER', 'database'), 'table' => 'sessions',
So now after doing:
$request->session()->flush()
to remove session in my controller, the session values are stilled stored in my DB. Although after flushing session in the controller I have checked session key exists or not where it is showing session does not exist, but why session are not deleted from DB? Also in my DB table sessions user_id is showing NULL. Why is that?
Earlier I used to store session in a file. Now I am trying to store session in database. Can anyone please help me.
user_idis null because you're not authenticated