wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session Expiration Doubt 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Session Expiration Doubt " Watch "Session Expiration Doubt " New topic
Author

Session Expiration Doubt

Sandeep Vaid
Ranch Hand

Joined: Feb 27, 2006
Posts: 390
Q-2 . P-248,
Session cookie vanish when the client's browser quits, but you CAN tell a cookie to persists on the client even after the
browser shuts down.. (by specifying time-out as -1 in web.xml)

So this means if i have not specified the time-out as -1 in web.xml, the session will be invalid when the client closes his
browser ?
Louis Moloney
Ranch Hand

Joined: Feb 06, 2007
Posts: 59
I think your alittle confused between session cookies and persistent cookies.

when you add a cookie to a response this will persist between opening and closing of the browser.

when you close a browser its session cookies (not cookies) will disappear from the browser. But the session will be alive on the web server as to such time as it times out.


Sandeep Vaid
Ranch Hand

Joined: Feb 27, 2006
Posts: 390
What is persistent cookie ?


HFSJ P-248 states that :
Session cookie vanish when the client's browser quits




Now when i am executing this for the first time, it's showing me : New Session

NOW I CLOSE MY BROWSER AND OPEN IT AGAIN :

Now when i access the servlet again, it shows me : Old Session

This means that session cookie DOESN'T Vanish even after i close my browser.


I am using mozilla, and i can see option :
Accept cookies from site:
Keep until : a) they expire
b) I close firefox
c) ask me everytime

Currently i have selected option a)

Does the concept has to do something with these options ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Expiration Doubt
 
Similar Threads
setMaxInactiveInterval and <session-timeout> question
How to set JSESSIONID's maxAge?
Session
Doubt between setMaxAge() and setMaxInactiveInterval() method
Confusion about session destruction