Session deletion on window close?
| From: | Neil Freeman | Date: | Tue, 22 Jan 2002 10:25:29 +0000 |
| Subject: | Session deletion on window close? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-81506@lists.php.net to get a copy of this message | ||
Hi there,
First off this may be more of a javascript question than PHP question
but I was wondering if anyone else has attempted something similar (and
it does involve the deletion of PHP sessions).
Here's the scenario: I have a 'stand alone' website on our intranet
which creates a PHP session upon startup. A new browser window is then
opened for the duration of the site - until the user has finished and
wishes to leave the system. This window cannot have a link to a standard
'logout' page, it needs to delete the PHP session when the browser
window is closed (possibly by launching a temporary page which calls the
necessary functions and then automatically closes via javascript).
The problem I have is that this site must work in both IE and Netscape
and this is what is causing me headaches :) Both browsers supposedly
support an 'onunload' event and I have managed to achieve what I want in
IE but Netscape refuses to lauch my 'logging out' page.
Does anyone have any suggestions as to how I could achieve the
following:
a) Browser window closed by user clicking on [X]
b) 'Logging out' page opened (which handles the PHP session deletion).
I hope this is clear enough.
Neil
--------------------------------
Email: neil.freeman@asa.co.uk
neil_freeman@yahoo.com
--------------------------------