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

Handling session timeout and session invalidate differently

 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Ranchers,

In my application i am using spring web flow, JSF (richfaces). I have a doubt and that is how can i differentiate between session timeout and a call to session.invalidate().

Because in case of session time out i want to redirect user to a Page A and in case user logs out of application i am invalidating the session and want user to redirect to login page.

Any pointer how can i achieve this because i am not able to handle session timeout and call to session.invaidate() differently.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you are the one invalidating the session, you can take whatever action you want afterwards. There's no need for detection as you know when you are invalidating the session.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, using HttpSession.getLastAccessedTime() and HttpSession.getMaxInactiveInterval() APIs you may be able to acheive the needful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic