tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <...@benshort.co.uk>
Subject Re: Cookie Rookie - cannot delete session cookie
Date Fri, 01 Jun 2007 13:59:32 GMT
Hi,

To delete a cookie you have to set its max age to 0.

Calling invalidate on the httpsession will delete the cookie that
holds the session id, wont it? request.getSession().invalidate()

Ben


On 6/1/07, Tim Funk <funkman@joedog.org> wrote:
> There is nothing in the servelt api to explicitly delete the session cookie.
>
>
> -Tim
>
> 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?
> >
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message