This function takes six arguments that descibe the functions used when creating your own session-handling functions. Each function can have any name, but the names must be passed in the correct order. In addition, each function must return the correct information. Using this function, it's possible to write any session handler that you want, including those that store their information in a database, text files, DBM files, or shared memory.
Executed when a session is initialized; can be used for various functions such as initializing variables. The save path and session name can come from the PHP ini file or via the session_save_path() and session_name() functions. Should return TRUE on success, FALSE on error.
Executed on shutdown of a session. Can be used to free memory or to destroy variables. Should return TRUE on success, FALSE on error.
Called whenever a session is started. If called with a session ID, the data associated with that session ID must be read and returned as a serialized string. If no session ID is passed, an empty string is returned. Should return FALSE on error.
Updates or adds new session data. The data to be written must be serialized. Should return TRUE on success, FALSE on error.
Removes any session data from the data store. Must return TRUE on success, FALSE on error.
Called at session startup. Designed to remove any sessions with a lifetime greater than the maximum. Should return TRUE on success, FALSE on failure.
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.