tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manea Mirko <m...@arena.sci.univr.it>
Subject Redirect and cookies
Date Wed, 24 May 2000 12:14:04 GMT
Hi,

   switching from jserv 1.1 to tomcat 3.1 I found that the following snippet
of code doesn't work any more:

String name = "foo";
String value = "admin";
if (name != null && name.length() > 0) {
    Cookie c = new Cookie(name, value);
    c.setMaxAge(4*60*60);
    c.setVersion(0);
    c.setPath("/");
    response.addCookie(c);
    response.sendRedirect(response.encodeRedirectURL("http://www.mysite.com"));
}

The problem is that if I try to set a cookie and then call 
response.sendRedirect, the cookie is not set at all. 
If I comment out the last line of code, the cookie is set. 
Is this a tomcat problem ? With jserv 1.1 this code worked fine.

Thanks very much,
		Mirko Manea

Mime
View raw message