Here are the a.php and b.php two files php.ini settings session.gc_maxlifetime equals 1
Access A.php After the session is generated and then access the b.php over 1 seconds, 5 seconds, 10 seconds to visit b.php why b.php inside the session has always been worth it? Why hasn't it expired?
Reply to discussion (solution)
Session.gc_maxlifetime indicates that SessionID can be deleted after the last access session.gc_maxlifetime seconds
Note: Can be deleted, not necessarily deleted
Whether or not to be deleted depends on the ratio of session.gc_probability/session.gc_divisor
PHP Default:
session.gc_probability = 1
Session.gc_divisor = 1000
That is, the probability of being deleted is 1 per thousand.
Also on some servers, if Session.save_path points to a temporary file directory that is not the operating system, the GC process will not function to his
Session temp file will persist until you manually clean up the garbage
Session.gc_maxlifetime indicates that SessionID can be deleted after the last access session.gc_maxlifetime seconds
Note: Can be deleted, not necessarily deleted
Whether or not to be deleted depends on the ratio of session.gc_probability/session.gc_divisor
PHP Default:
session.gc_probability = 1
Session.gc_divisor = 1000
That is, the probability of being deleted is 1 per thousand.
Also on some servers, if Session.save_path points to a temporary file directory that is not the operating system, the GC process will not function to his
Session temp file will persist until you manually clean up the garbage
The original is so, thank you very much!
There is also a problem is not very clear, SessionID can be shared, that is how to kick the user offline?
How to set a session with a strict 30-minute expiration date
Theoretically, SessionID cannot be shared.
Because SessionID is passed through a cookie and is valid for 0
Kick the user offline, generally need to use a custom session operation