Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Kill the Session

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session.invalidate() is a function to kill the Session.
Suppose a user close the broswer wihout proper logout, in that senario how to write a logic for that?
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use session time out, so session will be invalidated automatically after specified time out time
 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that is the another sernario(after time out)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have no reliable way to know if the user closed her browser or not.
Your app should never count on knowing when this happens.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic