*
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
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