On Thu, 06 May 2004 04:09:08 -0700, KhanyBoy wrote:
Is there a function to fire an event when a php session ends? When
this event is fired, I want to make some change to a database before
losing the session data.
I have a feeling it will involve session_write_close but not sure.
Thanks
Take a look at session_destroy() and session_unset();
http://us3.php.net/manual/en/function.session-unset.php http://us3.php.net/manual/en/functio...on-destroy.php
I'm pretty sure a session ends one of two ways: session_destroy()
(manually ending a session) or the browser is closed.
I don't think PHP sessions end quite the same way as ASP sessions, but I'm
not certain. You pretty much will always have the session data available
as long as you have session_start() at the top of each relevant PHP
script. The session is tied to the web browser -- an id based on some
unique parameters having to do with the particular browser instance. As
long as the browser is open, the session is intact for every page with
session_start() at the top of the page.
In order to save session data permanently, you have to do something with
it before the end of the script. Each PHP page is treated separately.
Not sure if this clears anything up for you.
--
Jeffrey D. Silverman | jeffrey AT jhu DOT edu
Website |
http://www.wse.jhu.edu/newtnotes/