tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Peremsky <>
Subject Re: Cookie Rookie - cannot delete session cookie
Date Fri, 01 Jun 2007 15:56:31 GMT
  Thanks to all who repsonded. I had already implemented all that everyone else had suggested,
but the one item I overlooked was resetting the path in the remove method of my cookie class
to match when it was created.
  Thanks you for making my friday A LOT brighter!

Torgeir Veimo <> wrote:
On 1 Jun 2007, at 14:48, Mike Peremsky wrote:

> I am pretty new to cookies and am having an issue. I create a 
> cookie in my servlet and write it to the response to last the 
> lifetime of the session (duration = -1). When the user clicks the 
> logout button I find the cookie, reset the duration to 0 then re- 
> add the cookie to the response. But when I look at the browser 
> cookies the cookie is still there and is listed as a cookie lasting 
> the lifetime of the session. From what I read in the API there is 
> nothing to directly remove a cookie from a session, I can only 
> write it with a duration of 0. So, why is the cookie still in the 
> session? How can I get rid of it?

Did you make sure the cookie you reset is using the correct path? The 
path has to match, not only the domain.

Torgeir Veimo

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message