lundi 21 décembre 2015

How long does data last in session in laravel?

Recently, I have noticed a very disturbing situation with my laravel 5 app which I can't seem to figure out. During login, I set the user_type variable in session like so

Session::put('is_supervisor', $user->is_supervisor);

In my config/session.php file, I have the following configuration:

'lifetime' => 120,
'expire_on_close' => false,

I have also implemented the remember me functionality.

I logged in as a supervisor user with remember me checked. After a few hours, I close the browser without logging out and launch again which logged into the user profile as expected since expire_on_close was set to false and remember me was checked. But, I notice that the is_supervisor variable didn't exist any more in session so I had to logout and login again to have the variable back in session. What could be the problem? I am using file as my session driver.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire