This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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 ?
 
 
subject: Session Expiration Doubt