I don't have to have it set on root. In fact now my code doesn't call setPath
at all and it works fine.

This is actually my first time ever using cookies. I've developed
traditional applications in the past. I really only need the cookie to be
visible to my login page but it doesn't really hurt if it is visible to any
other pages because this is the only place(as of now) that we use cookies in
our product.

How would I specify the path so that only my login page would be visible?
Since this is wicket and the URL paths are weird I don't really know how I
would do that. 

Thanks,

Josh

Johan Compagner wrote:
> 
> Because we cant really just call set path... That is something that
> you have to do. Why do you want it on root?
> 
> On 6/10/08, jchappelle <[EMAIL PROTECTED]> wrote:
>>
>> Thanks for the quick reply. I finally fixed the problem. What I found was
>> that when I was creating my cookie I was calling setPath("/") and when I
>> deleted it I was not calling setPath("/"). So I guess the equals method
>> saw
>> them as two different cookies and it wasn't deleting it. There is
>> actually a
>> convenience method on the WebResponse class called clearCookie that I am
>> calling. However, that method will not work if you have called
>> setPath("/")
>> on your cookie because it doesn't set the path. It just does the
>> following:
>>
>>      public void clearCookie(final Cookie cookie)
>>      {
>>              if (httpServletResponse != null)
>>              {
>>                      cookie.setMaxAge(0);
>>                      cookie.setValue(null);
>>                      addCookie(cookie);
>>              }
>>      }
>>
>> Thanks,
>>
>> Josh
>>
>>
>> richardwilko wrote:
>>>
>>> Ive had the same problem.  to delete a cookie do this:
>>>
>>> Cookie newCookie = new Cookie("my cookie name here!", null);
>>> newCookie.setMaxAge(0);
>>> newCookie.setPath("/");
>>> getWebRequestCycle().getWebResponse().addCookie(newCookie); 
>>>
>>> i dont know why (i didnt really look into it) but u seem to have to
>>> create
>>> a new cookie with the same name and add it.  maybe this is a wicket bug?
>>>
>>> Richard
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/forcing-cookies-to-expire-tp17067292p17760587.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/forcing-cookies-to-expire-tp17067292p17780251.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to