Re: session_destroy problem
| From: | Tamas Arpad | Date: | Mon, 13 Jan 2003 16:59:50 +0000 |
| Subject: | Re: session_destroy problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131447@lists.php.net to get a copy of this message | ||
On Monday 13 January 2003 15:14, Scott Fletcher wrote:
> Let us know how it goes... The unload event had been tried also. The
> javascript have been running for a while but the network communication is a
> bit tricky, it haven't worked well.
Sorry, maybe I missed or forgot the original problem. If I remember right the
problem is that the session must be deleted if the visitor closes the
browser. I think it can be done with the method that "ugly sex" sites use for
opening ads when their window is closed.
An example:
<body onunload="window.open('/destroysession.php?SID=....')">
I know it's not a 100% reliable sollution, but in javascript what is that?
This way you can make a request that'll destroy the session and sends
javascript code that immediately closes the window.
It works for me in opera but not in mozilla :((
Maybe there's another sollution, the idea is to somehow send a a request when
the onunload event happens (I'm sure you already knew this Scott). I tried to
search in google for how to make http request but didn't find anything really
useful in a few minutes, of course that doesn't mean that it can't work at
all.
Good luck with it Larry!
Arpi