• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logging out of System

 
Rahul Bhat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What require to implement by which closing a browser window would automatically log me out of a system?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add a JavaScript handler that triggers if the window is closed. That could access the server via an XmlHttpRequest object and tell the web app that the client is going away.
 
Rahul Bhat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please give me an example? And where i need to implement this code (Servlet or JSP).
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be in the JSP, because you need to generate an onClose handler as part of the BODY tag.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!