469,306 Members | 2,512 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Find onUnload Destination URL

I am trying to kill a cookie using onUnload if a user leaves the site
or closes the browser window so someone else can't get a person's
session.

Does anyone know if there's a way to check where the window is going
before it gets there?

Many thanks in advance.

-Ted
Jul 20 '05 #1
4 8018
In article <58**************************@posting.google.com >,
do******@gwu.edu enlightened us with...
I am trying to kill a cookie using onUnload if a user leaves the site
or closes the browser window so someone else can't get a person's
session.

Does anyone know if there's a way to check where the window is going
before it gets there?


No.

Using a session cookie solves the latter problem.
I have yet to see a good solution to the former. Which is why even
banking sites tell you to use their log out button to log out for
security, I'd imagine. If they can't figure out a good solution, I'd
wager there isn't one.

(Note: a GOOD solution. Not one that only works in some browsers for
some people on the third tuesday of every month.)
--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
do******@gwu.edu (TDonohue) writes:
I am trying to kill a cookie using onUnload if a user leaves the site
or closes the browser window so someone else can't get a person's
session.
Impossible, if you want to be absolutely certain.
The onunload handler, if any, is called when you leave the page, no
matter how you leave it (except killing the browser so fast it doesn't
get to do anything or turning off the computer). You don't get to know
why it is called.
Does anyone know if there's a way to check where the window is going
before it gets there?


None. If he follows a link on the page, you can check it, but just
entering something in the address bar is (luckily) not detectable.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
On Thu, 15 Jan 2004 23:33:42 +0100, Lasse Reichstein Nielsen
<lr*@hotpop.com> wrote:
The onunload handler, if any, is called when you leave the page, no
matter how you leave it [...]


Opera doesn't appear to execute onUnload event handlers when you close the
browser or the page's tab. In fact, I've only found it do so when you
navigate to another page.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #4
Michael Winter <M.******@blueyonder.co.invalid> writes:
Opera doesn't appear to execute onUnload event handlers when you close
the browser or the page's tab. In fact, I've only found it do so when
you navigate to another page.


Great :) Just the way I want it.

So, on top of not being certain of being called, it is not even
consistent in when it is called across browsers. Another vote for
forgetting onunload! :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ric Castagna | last post: by
3 posts views Thread by Andoni | last post: by
2 posts views Thread by Simon Wigzell | last post: by
3 posts views Thread by Laurent | last post: by
3 posts views Thread by Weston Weems | last post: by
1 post views Thread by Tim Arview | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.