NYCPHP Meetup

NYPHP.org

Sessions. Pesky, pesky sessions.

Wayne Cope \(Intercart\) wayne at intercart.co.uk
Sun Jul 21 12:23:32 EDT 2002


Hi all,

No problem using sessions as such, but I'm over-riding the default read,
write, destroy functions used for sessions so that when a session is
destoyed I ncan set a flag in a database pertinent to the session.

All works fine except if the browser is closed or something unfortunate
happens and the connection is lost etc., the server doesn't seem to
acknowledge that the session has died and promptly fails to run the destroy
code.  If I explicity call the session_destroy() function everything works
fine.

In ASP it's pretty much taken for granted that the session destory code
equivalent is called when a session ends, wether it be closed explicitly, by
expiry, or by closing the browser or some other method of loosing the
session with the server.

Does anybody know how I can achieve what I'm trying to do - yes I could pop
some JavaScript to detect closing the browser, but that doesn't account for
loss of connection etc.

Any help much appreciated.

Wayne....







More information about the talk mailing list