Session Function OverviewSession functions provide a unique identifier to a user, which can then be used to store and acquire information linked to that ID. When a visitor accesses a session-enabled page, either a new identifier is allocated, or the user is re-associated with one that was already established in a previous visit. Any variables that have been associated with the session will become available to your code through the $_SESSION superglobal. Session state is usually stored in a temporary file, although you can implement database storage using a function called session_set_save_handler(). The use of session_set_save_handler() is beyond the scope of this book, but you can find more information at http://www.php.net/session-set-save-handler. |