NYCPHP Meetup

NYPHP.org

[nycphp-talk] Sessions. Pesky, pesky sessions.

John Ensign dev at thebinarylab.com
Mon Jul 22 02:36:26 EDT 2002


Maybe this might work for you?

http://www.php.net/manual/en/features.connection-handling.php

Register a shut-down func, and call destroy if connect goes south? <- hack
... ?

Also, off the top of my very very small head....

I know that when over-riding the session functions, if an error occurs,
sometimes you get no message, even with all settings full on for
reporting... so you might just double check that the functions themselves
are working...?

Hope any of this helps,

John

-----Original Message-----
From: Wayne Cope ( [mailto:wayne at intercart.co.uk]
Sent: Sunday, July 21, 2002 10:27 AM
To: NYPHP Talk
Subject: [nycphp-talk] Sessions. Pesky, pesky sessions.


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