• 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

Doubt in Cookies

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I am new to Servlets and am working on Cookies using Apache/IE.
My problem is when I say res.addCookie() a text file is NOT getting created.Shouldn't res.addCookie() always create a text file??? What could be the problem??Kindly help..
Thanks ,
Pradeep.D
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How the browser handles storing cookies is up to the browser designer. The cookie specification does not say a thing about how the browser should handle storage. Cookies created with short lifetimes won't be stored. The JavaDocs for javax.servlet.http.C o o kie have handy notes.
 
DPradeep Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for ur reply.I saw the javax.servlet.http.Kookie specification It says.
"Cookies affect the caching of the Web pages that use them. (HTTP 1.0) does not cache pages that use cookies created with this class. This class does not support the cache control defined with (HTTP 1.1.) "
So I think I cannot use addKookie() .What else can I do to add/create a cookie from a servlet???
I also tried seting the setMaxAge to 10000.Still it is not created.Is there anything I should do in the Tomcat config?
When I visit webpages cookies are set in 'text' files.So I think browser is fine..right??Thanks again for ur help.
Please reply.
Thanks,
Pradeep.D
 
DPradeep Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After seting the setMaxAge() it works....Thanks again..
Thanks,
Pradeep.D
 
That is a really big piece of pie for such a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic