This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

state of session object after timeout

 
Sanjeev Kaushik
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
could someone please let me know, what would be state of the session object once it is timed out.
Will it be null?
If I do operation session.getAttribute("KEY"), what I'll get if this is done on the timed out session.
Thanks
Sanjeev Kaushik
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it will be null.
 
Sanjeev Kaushik
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the exception I am getting, I understand that session object is not null. If I get something out of session, that is returned null.
Can someone verify.
Sanjeev Kaushik
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If session times out and you call
1 .request.getSession() or request.getSession(true) a new session will returned
2. request.getSession(false) will try to get old session .The old session has timed out so the return value will be null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic