473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 8197
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ric Castagna | last post by:
I have a form that I'm trying to handle if the viewer "leaves" without completing the entire thing. The client wants to be advised that someone one "tried" to fill out the application. Most...
3
by: Andoni | last post by:
Hi, I am only writing for IE 5.5+ so no need for compatibility at all ;-) I am trying to get my users to logoff which they finish on a particular page. This is no problem (or should be no...
2
by: Simon Wigzell | last post by:
I'm using OnUnLoad in my body statement to redirect to a function to clean things up if someone exits a form by closing it from outside the webpage code - e.g. by not using the cancel or save and...
3
by: Laurent | last post by:
I am trying to use the onunload event to know when the user closes a popup by receiving a request on the web server. I have a main page from where the user opens a popup. What I want is when the...
3
by: Weston Weems | last post by:
Ok, I've posted on this before, lemme give you guys the run down. I've got an asp form that has postbacks etc. I'd like it so that when navigating away from it, It'll prompt user for save...
1
by: Tim Arview | last post by:
Hi, I'm trying to create an exit popup that doesn't require anything added to the body tag. In other words, I don't want to say <body onunload="foo">. I just want to have window.onunload="foo"...
0
acoder
by: acoder | last post by:
Problem onload and onunload events do not fire when going back, forward or refreshing the page Browser Opera Example Any code using onload or onunload, e.g. window.onload = init; where...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.