I'm using Tomcat 5.5.9 (and tried higher versions too) and jdk1.5 update 06. When i use following code in my JSP - cookies are not set to client. // DO NOT WORK Cookie cookie = new Cookie("name", "value"); cookie.setMaxAge(3600); response.addCookie(cookie); If i remove 2nd line - all works OK. // WORKS OK Cookie cookie = new Cookie("name", "value"); response.addCookie(cookie); This happnes only on linux computers (we use Gentoo). On windows everything is working OK. Before i've been using j2sdk1.4.2_08 and Tomcat 5.0.30 and never seen this problem.
> Cookie cookie = new Cookie("name", "value"); > cookie.setMaxAge(3600); Did you try other values as well? 3600 = 1 hour, which could be a timezone difference (maybe one of the machines has wrong timezone settings) Did you check the HTTP headers of the response? Or did you just look in the Cookie-store of your browser?
(In reply to comment #1) > > Cookie cookie = new Cookie("name", "value"); > > cookie.setMaxAge(3600); > > Did you try other values as well? 3600 = 1 hour, which could be a timezone > difference (maybe one of the machines has wrong timezone settings) > Yes, I've tried many of another values. > Did you check the HTTP headers of the response? > Or did you just look in the Cookie-store of your browser? Hmm. Sorry my mistake. I've been looking only into cookie-store of browsers. I'm still researching a bug. Try to give you as many info as i'll be able to obtain.
Waiting for more data from original poster and/or a confirmation that it works for him now in 5.5.16 or later.