wood burning stoves 2.0*
The moose likes Servlets and the fly likes state of session object after timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "state of session object after timeout" Watch "state of session object after timeout" New topic
Author

state of session object after timeout

Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
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


Sanjeev Kaushik
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

Yes it will be null.


Groovy
Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
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

Joined: Feb 27, 2002
Posts: 8904

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.
 
jQuery in Action, 2nd edition
 
subject: state of session object after timeout
 
Similar Threads
session timeout problem
How to prevent duplicate logins
Session Does Not Time Out
Urgent !!! Serializing Session Object
Query reg JSP session