Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session expire time in Laravel

The session expire time is 30 minutes(1800 seconds) in my project. Im using Laravel 5.2 and I save session in redis.

However, I am confused by this:

If I write data to the active session, while its TTL is 100 seconds, the sessions new TTL is now 1800 seconds again.

So could someone tell me why this happens? I guess Laravel will reset session expire time after writting data to the session, but I am not sure about that now.

like image 830
Summer Su Avatar asked Nov 07 '17 08:11

Summer Su


1 Answers

Session is renewed every time the session_start(); is called. This will happen when you for example refresh the page, write data to the session etc. Its not 1800 seconds from the time a session is created, and then it closes after 30 minutes. Its 30 minutes from the last time the session was accessed

like image 154
Ole Haugset Avatar answered Sep 17 '22 20:09

Ole Haugset