Maybe it's about the script name (and thereby the cookie path)? Have you carefully inspected your cookie cache?

It took me a long time to come up with this, but it works in all cases that I've found. I'll share it FWIW maybe it will give you some ideas:

SET:
CookieParser cp = data.getCookies();
DynamicURI dui = new DynamicURI(data, "/");
dui.removePathInfo();
dui.setScriptName("/");
cp.setCookiePath(dui);
cp.set("myCookieName", "myCookieValue", 60*60*24*365);


GET:
           CookieParser cp = data.getCookies();
           String myCookieValue = cp.getString("myCookieName");

HTH, debugging this sort of thing isn't especially fun :<


At 8:42 PM +0100 2/22/03, Henrik W. Hansen wrote:
Hi all
I am having problems setting a cooike on a RedHat 7.3 with tomcat 4.1.18 and JDK141_01. The thing is, that I am able to read and write cookies on the same configuration on a WinXP. The code setting the cookie is:
Cookie userVote = new Cookie("havepolled", "somethingmeaningfull");
userVote.setPath(data.getRequest().getContextPath());
userVote.setMaxAge(2592000);
data.getResponse().addCookie(userVote);


How come the behavior differs?

Any suggestions are welcome!

/Henrik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to