Session expire time in Laravel

Viewed 4148

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.

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

Related