Find onUnload Destination URL

T

TDonohue

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
 
L

Lasse Reichstein Nielsen

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
 
M

Michael Winter

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
 
L

Lasse Reichstein Nielsen

Michael Winter said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top