"Session will be invalidated after a time-out period defined by Servlet Container" - From HFSJ I know session can be invalidated by invalidate(), or specifying time-out in DD or if the browser crashes. But what is meant by time-out defined by servlet container ? is it a default value specified in servlet container?
Joined: Aug 21, 2006
Yes, "time-out defined by servlet container " is the default value for session timeout defined by the container.
Most of the containers let you set this default timout period(I am sure of WebSphere atleast).
Thanks and regards, Saurabh
Joined: Apr 30, 2007
If the browser crashes, that does not invalidate your session. You may not be able to get back to the session because you lost the cookie holding the session id, but technically your session is still active until it times out.
Joined: Apr 19, 2007
Thanks for the replies.
Joined: May 22, 2006
Just like this javaranch page if you close the browser it still logs you in!!
Joined: Mar 08, 2007
And what if i have defined the session-timeout in the DD ? The one defined in the DD will be used instead of the Container's default one right ?
Please clear my doubts, thank you ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Joined: Dec 04, 2004
Yes, The time interval defined in the DD will be used instead of the Container's default one right. Also You can set the inactive interval by the session method setMaxInactiveInterval(int interval) programmatically.
In DD we define interval in minutes whereas in the above method the time interval is in seconds.