File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes server to be notified when browser closes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "server to be notified when browser closes" Watch "server to be notified when browser closes" New topic
Author

server to be notified when browser closes

mohan kumar nie
Greenhorn

Joined: Feb 05, 2002
Posts: 12
when user closes the browser, I want server to be notified.
If I use <BODY onUnLoad="javascript:notifyServer()"> , this will be called everytime when user request for another page.
How to achieve above functionality in Microsoft Internet explorer.
prabhat kumar
Ranch Hand

Joined: Apr 11, 2001
Posts: 114
check for window.closed property of window object
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

This is one of the most often asked questions in the forum... Do a search and you should be able to find more info.
The main point is that you can't be guaranteed that your server will be notified everytime a browser is closed, so don't count on it.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
prabhat kumar
Ranch Hand

Joined: Apr 11, 2001
Posts: 114
what u really want to do by knowing the browser closing?
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
You don't know when the user closes the browser. This is why you have a session timeout. There is no way to tell from the server side if the user has already left or not until the session has timed out.
-Dale


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: server to be notified when browser closes
 
Similar Threads
Session handling
cleint disconnecting without logging out....
server to be notified when browser closes
logout on browser close
Session