Hi,

I am trying to manage cookies in Wicket. I can create them and read them no 
problem, but forcing expiry by setting maxAge=0 does not seem to be working. 
Here is the code:

Set cookie:

      public void setRememberMeCookie(String username)
      {
            Cookie cookie = new Cookie(REMEMBER_ME_COOKIE, username);
            cookie.setMaxAge(-1);
            cookie.setPath("/");
            getWebRequestCycle().getWebResponse().addCookie(cookie);
      }

Clear cookie:

      private void clearCookie(String name)
      {
            Cookie cookie = 
getWebRequestCycle().getWebRequest().getCookie(name);
            cookie.setMaxAge(0);
            getWebRequestCycle().getWebResponse().addCookie(cookie);
      }

The code is definitely called. However, the cookie remains. What am I doing 
wrong?

Thanks

_______________________________________________________

The  information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial  use  of  the individual or entity to which it is
addressed and may contain information that is  propri-
etary  and  confidential.  If you are not the intended
recipient of this message you are hereby notified that
any  review, dissemination, distribution or copying of
this message is strictly prohibited.  This  communica-
tion  is  for information purposes only and should not
be regarded as an offer to sell or as  a  solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be  secure  or  error-
free. P6070214

Reply via email to