> > 39) How do I delete a cookie with JSP? TOC
> > From: Chris Fesler <[EMAIL PROTECTED]>
> > A little more experimentation, and I came up with a method to
> delete
> > cookies. Say that I have a cookie called "foo," that I set a
> while ago & I
> > want it to go away. I simply:
> > <%
> > Cookie killCookie = new Cookie("foo", null);
> > killCookie.setPath("/");
> > killCookie.setMaxAge(0);
> > response.addCookie(killCookie);
> > %>
> > Note that this is -not- how the JSDK documentation indicates
> cookies
> > are to be deleted, but what the heck -- it seems to work.
Cool, I'm immortalized in the FAQ : )
Actually, it turns out that it's not quite this easy -- with some JSDK / JSP
engine combos (actually, I'm pretty sure it's the JSDK that matters, but I
can't demonstrate that with certainty), even this method doesn't work when
the client's clock is *behind* the server's clock. The problem is that with
some versions (e.g., WebSphere with 0.91 JSP), setMaxAge(0) sets the expire
time to the time when the call is made. If the client's clock is behind
that, then it thinks the expire time is in the future, and doesn't expire
the cookie.
The only combo I know that works is JRun 2.3 (which uses JSDK 2.1, I
believe).
c
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".