When loading each page, I run session_start() to resume the current session. When does the session.gc_maxlifetime countdown begin? Is session_start() called for the first time and is this session cookie set? Or does the timer restart every session_start() ?
When setting session.gc_maxlifetime for about 24 minutes, when on this timeline, session data will be collected in the garbage collection
1. 12:00:00 First page load, session_start(), session cookie created 2. 12:10:00 page load, session_start() 3. 12:26:00 page load, session_start() 4. 12:55:00 page load, session_start()
If the timer starts when the first page of session_start() loaded, I would expect it to collect garbage when loading 3. But if it resets every session_start() , then it will not be collected before loading 4.
I hope this is the last one, because then I could do javascript heartbeat every few minutes to call the page with session_start() .
If this is the first, session.gc_maxlifetime starts counting from the moment the session cookie was created, do I need to destroy / recreate or regenerate the id to reset count?
php session
Tyson of the northwest
source share