tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bedell, Kevin" <KBed...@cmgi.com>
Subject RE: addCookie() and sendRedirect() why does cookie not get set?
Date Tue, 13 Jun 2000 14:15:02 GMT
Is the cookie valid in the place you're redirecting to? Is the new URL in
the cookie domain and at a valid path within the domain?

Also, I've heard of this problem before. I haven't validated it, but is
Set-Cookie a valid HTTP header when sending a "Location: " (ie, http
redirect) to a browser.

That is, does the HTTP protocol allow cookies to be set when the reponse is
a redirect?




 

> -----Original Message-----
> From: Lasseter Gary W (Contractor) 
> [mailto:gary.lasseter@logsa.army.mil]
> Sent: Tuesday, June 13, 2000 9:56 AM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: addCookie() and sendRedirect() why does cookie not get set?
> 
> 
> Folks,
> I'm setting a cookie with resp.addCookie() and later on using 
> sendRedirect() to go to another .html...  My cookies will not set.
> Is my HttpServletResponse getting trashed?  
> 
> I can get a PrintWriter 
> and out put stuff and the cookie gets set - just can't use 
> sendRedirect().
> 
> For now I'm outputting (with PrintWriter) "...<META 
> HTTP-EQUIV="Refresh"
> Content=0; URL="page.html">..." which is a HTML technique for 
> redirection.
> I hate doing it this way.
> 
> Is there a way to make addCookie() work in combination with 
> sendRedirect()?
> 
> later,
> gary
> 
> 
> --------------------------------------------------------------
> ------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
> 

Mime
View raw message