Laravel 5 Session Lifetime

According to Laravel config/session.php

/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/

'lifetime' => 120,
'expire_on_close' => true,
'expired-session-redirect' => url(env('APP_URL'))

I set the lifetime of my session to 120minutes, but I have the feeling that my user has logged out before 120 minutes.

This is a missprint? They mean 120 seconds, which is 2 minutes?

Can anyone shed some light on this?

+4
source share
1 answer

Check your php.ini for:

session.gc_maxlifetime - default 1440 seconds - 24 minutes

session.gc_maxlifetime indicates the number of seconds after which data will be considered garbage and potentially cleared. Garbage collection can occur during a session (depending on session.gc_probability and session.gc_divisor).

session.cookie_lifetime - 0

session.cookie_lifetime cookie , . 0 " ". 0. . session_get_cookie_params() session_set_cookie_params().

, , Laravel, cookie , php.ini Laravel.

/.

, - , .

+5

Source: https://habr.com/ru/post/1668540/


All Articles