Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The persistence of cookies

 
Art Metzer
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • 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
 
Randall Twede
Ranch Hand
Posts: 4442
3
Java
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks, Randall! setMaxAge() works beautifully, as advertised!
Art
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic