tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jones" <kev...@develop.com>
Subject RE: addCookie() and sendRedirect() why does cookie not get set?
Date Tue, 13 Jun 2000 14:17:26 GMT
Where are you re-directing too?

If you are redirecting to the same context then you should be using a
RequestDispatcher, if you are redirecting off-host then adding cookies won't
work. Cookies are associated with the host/domain they were sent from, a
browser shouldn't forward a cookie from you to a different domain,

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: Lasseter Gary W (Contractor) [mailto:gary.lasseter@logsa.army.mil]
> Sent: 13 June 2000 14:56
> 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