note 11336 added to session_set_save_handler

From: Date: Fri, 16 Feb 2001 15:02:44 +0000
Subject: note 11336 added to session_set_save_handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-11145@lists.php.net to get a copy of this message
Something which *seems* to be the case, but is not clearly documented, (and was confusing to me): The open() close() read() write() destroy() and gc() functions of session_set_save_handler are *private* functions! You will never need call them directly once they have been set up. PHP will automagically generate a session id and use it as directed in the private functions. I found a good tutorial on this by Ying Zhang on phpbuilder.net but it was still not obvious to me where the session key (or id or whatever you want to call it) was coming from, until I finally realized that I don't ever need to know where it comes from! If I call session_start() from a script after setting up the save handler functions, the key is automagically generated and put in the place that my save handler functions tell it to. Same with session_destroy; calling this automagically knows what the current session id value is. If anyone has anything to say different about this functionality, please let me know. -Jeff http://www.php.net/manual/en/function.session-set-save-handler.php

« previous php.notes (#11145) next »