• 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

The persistence of cookies

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, friends.
This may be a silly question, but I'll go ahead and ask it anyway.
I'm a servlet expert-in-training , currently studying cookies. The cookies that get created in the textbook examples that I'm running get stored in the HttpServletResponse as HTTP headers, where they presumably cease to exist once the session ends. But in my practical experience, "real" Web sites' cookies are truly persistent: Web servers store them in my C:\Windows\Cookies folder as those all-too familiar 1-KB text files. My toy examples don't do this, and my question is, what would I need to do to create my own truly persistent cookies?
Thanks for helping me along,
Art
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This will make the cookie last for a year:

oops I just noticed there are 365 days in a year not 356
[This message has been edited by Randall Twede (edited February 22, 2001).]
 
Art Metzer
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Randall! setMaxAge() works beautifully, as advertised!
Art
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic