• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Expiration Doubt

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic