You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by Mike Stover <ms...@apache.org> on 2002/09/20 21:47:59 UTC
Re: Different behaviour of Cookies in CookieManager and Webbrowser
Good catch - I will change so the default path is "/".
-Mike
On 21 Sep 2002 at 0:49, Tom Wiedenhöft wrote:
> Hallo again,
>
> I'm using the CookieManager in my Programm.
> I found a different behaviour between the CookieManager and a Webbrowser
> (Konqueror 3.0, Suse Linux, KDE)
>
> The CookieManager finds just those Cookies where the current URL starts with a
> URL of a saved Cookie:
> ---schnipp---
> if (url.getHost().endsWith(cookie.getDomain()) &&
> url.getFile().startsWith(cookie.getPath()) &&
> (System.currentTimeMillis() / 1000) <= cookie.getExpires())
> ---schnapp---
>
> Provided my first JSP
> "http://localhost:8080/examples/jsp/virformation/redirect_set_cookie.jsp"
> sets a Cookie and redirects to a second JSP
> "http://localhost:8080/examples/jsp/virformation/redirect_set_cookie_target.jsp"
> This JSP checks the cookie that was set by the first JSP (for example for
> security reasons). The CookieManager now compares the paths
> "/examples/jsp/virformation/redirect_set_cookie_target.js".startsWith("/examples/jsp/virformation/redirect_set_cookie.jsp")
> and does not set the cookie. The Konqueror Browser does it. To avoid this my
> fist JSP has to set the cookie like this:
> ---schnipp---
> response.setHeader(
> "set-cookie",
> "cookie_name=i_am_a_redirected_cookie; path=/examples/jsp/virformation");
> ---schnapp---
>
> Is this the behaviour you want?
>
> Ciau.
> Tom
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>