How long does a laravel session last?

Recently, I noticed a very disturbing situation with my laravel 5 application, which I cannot understand. During login, I set the user_type variable in the session as follows

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 also implemented the "remember me" function.

I registered as a supervisor user when I remember how I checked. After a few hours, I will close the browser without logging out and not starting it again, logging into the user profile as expected, as it expire_on_closewas set to false, and remember that I was checked. But I noticed that the is_supervisor variable no longer existed in the session, so I had to log out again and log back in to return the variable to the session. What could be the problem? I use the file as my session driver.

+3
source share
1 answer

you need to understand what will happen, you will set the session lifetime to 120 minutes, after 120 minutes the session will be reset.

" " cookie, , , , cookie , cookie .

- ? , , if ($user->is_supervisor)

is_supervisor db,

+1

All Articles