On Tue, 27 Aug 2002, Michael Remijan wrote:
> Date: Tue, 27 Aug 2002 16:30:29 -0500
> From: Michael Remijan <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: RE: how to delete a cookie?????
>
> I was able to trace the source of the problem. When I add the cookie I
> call setPath("/"); because I want the cookie visible across multiple
> webapps. However, when I get the cookie out of the response by calling
> getCookies(), the value of getPath() = null!
That is a side effect of the way cookies are actually transmitted (see
<http://www.rfc-editor.org/rfc/rfc2109.txt> for the specification). In
short, the only thing that your browser sends on the subsequent request
are the cookie name and the cookie value for all matching, non-expired,
cookies.
> So it's like the path
> information disappeared or isn't being reconstructed correctly! So
> after I get the cookie from the request, I call setPath("/") again and
> call setMaxAge(0), readd it to the response by calling addCookie(c) and
> with that the cookie was sucessfully deleted! Not having the "/" path
> persisting really through me. I didn't think of it because it seemed
> like such an obvious thing that tomcat would handle.
>
Tomcat doesn't do *anything* with your application's cookies -- it just
sends exactly what you tell it to, and assumes that you know what you are
doing.
>
> <mike/>
>
Craig
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>