• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in Cookies  RSS feed

 
DPradeep Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
After seting the setMaxAge() it works....Thanks again..
Thanks,
Pradeep.D
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!