By default, PHP stores sesssion information on the filesystem. Each session has one file containing serialized session variables.
When the GC runs, it loops through the entire directory where the session files reside. For each session file, the filesystem mtime is subtracted from the current time, and if this amount of time is greater than session.gc_maxlifetime, the session file is deleted.
In other words, accessing an 'expired' (i.e. according to the lifetime you specified) session stored in a particular directory will cause other 'expired' session files in that directory to be cleaned up as well. Therefore, be careful when modifying the session.gc_maxlifetime. You may want to give your script its own session.save_path so that you do not unintentionally clobber other sessions.
|