Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

handling window closure

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi!

How can my web application recognize that the user closes the browser window by clicking the "x" on the top right? I want to delete a cookie that my application sets, when the user leaves the application. I have a logging-off-function, that deletes the cookies, but this can only happen when the user clicks the "log off" button. But what if when s/he just closes the browser without logging off?

Thanx!
Rondra
 
Put whatever the button does in the OnUnload method of the body.

<BODY OnUnload=&quot;SameAsButtonClick();&quot;>

That is run even when the &quot;x&quot; is clicked.So it should work for you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top