Dead Session and Expire

  • warning: include(/tmp/fortune.txt): failed to open stream: No such file or directory in /home/mohawksoft/org/www/htdocs/includes/common.inc(1696) : eval()'d code on line 1.
  • warning: include(): Failed opening '/tmp/fortune.txt' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/mohawksoft/org/www/htdocs/includes/common.inc(1696) : eval()'d code on line 1.

After a few discussions with some fellow developers, I think the policy of timeout and expire should be this:

timeout remains as it is, that is, sessions that have not been used within the "timeout" period of time will be flushed from the MCache. If you use a persistent storage system, a flushed session will be saved to disk, otherwise the session is lost.

A new parameter, "expire" will be used by persistent storage systems and ignored by MCache generally. The persistent storage system will use this parameter to delete sessions that have expired.

The only remaining issue not addressed by this solution is what I'll call "timely expire" in which sessions are actively removed (from MCache and persistent storage) at the moment they expire. Since timeout and expire are more or less along the lines of "garbage collection," I think lazy deletes are appropriate for the functionality. If you need something more active, there is a delete mechanism that can be used to explicitly delete a session in MCache and persistent storage.