This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Servlets and the fly likes cleint disconnecting without logging out.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "cleint disconnecting without logging out...." Watch "cleint disconnecting without logging out...." New topic

cleint disconnecting without logging out....

mustang india
Ranch Hand

Joined: Feb 05, 2002
Posts: 60
I would like to know how to keep track of a browser bacsed cleint when he/she abruptly closes the connection with servlet. Let us say I have a browser based cient and a server running a servlet. I can understand the client logging out if he "logs out". My question is how can the server get notified if the client closes the browser window without logging out.
Thansk in advance.
Les Dsouza

Joined: Jan 29, 2002
Posts: 27
The browser does not notify the server when the user closes the window.
Hence we need to depend on the session timeout to invalidate the users session. Another similar approach is to have a thread which will continuously monitor the users sessions (which need to be kept in a list or hashtable) any session that has not been active for a defined time can then be invalidated (after doing any process if necessary).
I agree. Here's the link:
subject: cleint disconnecting without logging out....
It's not a secret anymore!