I know this doesn't relate to your question, and I don't know what your app
is at all, but does this cookie automatically log someone in to your app if
they come back later?  If so, you probably don't want to use the username
for that.  Then I can just pick someone else's username, fake my cookie, and
come to the app and be logged in as them.

You're probably not doing that - maybe you're just using it like Josh was -
to prefill a username field - but I would've felt remiss if I didn't mention
it.  :)

On Wed, Jun 11, 2008 at 10:13 AM, jchappelle <[EMAIL PROTECTED]> wrote:

>
> 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]
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com

Reply via email to