Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

tomcat and cookies problem

Vaduvoiu Tiberiu

2007-07-30

Replies:

Hi, guys. I'm running tomcat 6.0.3 and I'm having a problem with cookies in jsp. After I set a cookie time using cookie.setMaxAge(3600), when I run cookie.getMaxAge() I get -1 instead of 3600(cookie is a object of type javax.servlet.http.Cookie). As I read on the internet about this issue I understood that depending on application server and configuration, cookies can be generated automatically by servlet engine. In such case you can control the max age trough configuration. As I understand, the reason why i get -1 is because

The server sets cookie values using this response header:
Set-Cookie: NAME=VALUE; expires=DATE;
path=PATH; domain=DOMAIN_NAME; secure

while client sends cookies using this request header:
Cookie: NAME1=OPAQUE_STRING1; NAME2=OPAQUE_STRING2

So to my understanding, I need to configure this somehow in tomcat. true? I haven't found any articles related to this though anywhere. Can someone help me out with some info?? 10x a lot in advance


   
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.