On Tue, 7 Dec 2004 11:50:58 -0500, Josh Howe <jhowe@xxxxxxxx> wrote: > I've looked at the php session documentation, and it doesn't look like > there's any way to run code when a session expires. I'd like to do some > cleanup when a user's session expires, is there any way to trap this? > Thanks. You can define your own session handling functions with and override PHP's default session handling with session_set_save_handler(). One of the functions you would define would be the garbage collection function. Once created you can call this function whenever you like. I wrote a drop-in replacement for PHP sessions that gives you what I just described, it uses MySQL: http://destiney.com/pub/php_db_sessions.tar.gz There's also the database abstraction layer ADOdb which gives you callback functionality in garbage collection: http://adodb.sf.net/ The db driven, encrypted and bzip'd sessions are pretty nice too. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php