• 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

Cookie.setMaxAge(-1), will the cookie expire after the browser is closed?

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cookie.setMaxAge(-1) will make the cookie expire after the browser is closed, this is what HFSJ says on Session Management chapter and this is what the Javadoc for the method says, but Session Management chapter's mock exam question number 3's answer says that if we met the max age to -1, the cookie will never expire.

I checked out the errata, but there seems to be no errata on this. Am I getting confused with some simple thing? Or is the answer wrong for that question? Can anyone confirm it?

Thanks,
Srikanth
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Srikanth..

this will help you !
 
Srikanth Raghavan
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Niranjan,

It was a very useful post by you, helped me a lot and now I realized that there are two things --session timeout and cookie timeout. . I think that is what confused me. Thanks again.

Regards,
Srikanth
 
reply
    Bookmark Topic Watch Topic
  • New Topic