I am wondering how PHP detects that a particular session has ended.
In detail: I use the default session handler (file-based), with the default session lifetime, and so on. Everything in php.ini is by default.
If the session is now running, PHP checks (depending on non session.gc_divisor and session.gc_probability) if there are any timeouts. But where does PHP get the time of the last access session from the sessions to validate?
The session file itself contains only the workload, for example. x|i:1;
for a $_SESSION['x'] = 1;
therefore there is no information about the session access time.
I think that there is no information in the memory about the start time of the session, since the sessions still work after the server is completely restarted.
So where does PHP get information from? Is this a mtime / ctime session file comparison?
source share