Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cleint disconnecting without logging out....

 
mustang india
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
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
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic