• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find a session invalidation because of inactivity?

 
Jaydeep Deshmukh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To invalidate an HttpServlet session , I can either call its invalidate() method or because of a Session Timeout due to client inactivity. Is there a way to find out if the session was invalidated because of a call to the invalidate method or due to Session Time out?
Thanks in Advance
Jaydeep
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaydeep,
No, but since you control all the calls to session.invalidate(), you can set some variable. If the variable isn't set when the listener's unbound method is called, you know that the session timed out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic