Hello Oleg,
Then, how is it possible that I always receive -1 in "maxAge" attribute? Am
I forgetting something, or doing something wrong?
If I try to set the MAX_AGE_ATTR and the EXPIRES_ATTR, I get -1 again.
How is the correct way to propagate the cookie expiry date?
Thanks in advance,
Joan.
Date expires = new Date(System.currentTimeMillis() + 60000);
BasicClientCookie bcc = new BasicClientCookie("testName", "testValue");
bcc.setVersion(1);
bcc.setDomain("wstest.rhodasol.es");
bcc.setPath("/wsserhs/rhodasol");
bcc.setSecure(false);
bcc.setExpiryDate(expires);
bcc.setAttribute(ClientCookie.VERSION_ATTR, "1");
bcc.setAttribute(ClientCookie.DOMAIN_ATTR, "wstest.rhodasol.es");
bcc.setAttribute(ClientCookie.PATH_ATTR, "/wsserhs/rhodasol");
bcc.setAttribute(ClientCookie.MAX_AGE_ATTR, "60");
bcc.setAttribute(ClientCookie.EXPIRES_ATTR, DateUtils.formatDate(expires));
-----Mensaje original-----
De: Oleg Kalnichevski [mailto:[email protected]]
Enviado el: miércoles, 08 de julio de 2009 23:54
Para: HttpClient User Discussion
Asunto: Re: Http trace for cookies
Joan Balagueró Valls wrote:
> Hello Oleg,
>
>
>
> Im trying to send you the trace, but your mail server does not accept it.
>
>
>
> I paste here a couple of lines of this trace:
>
>
>
> This is the interesting part of the trace. The expiry date is correct in
the
> line 7 (60 seconds from now). But it seems this expiry date does not
appear
> in Cookie header.
>
>
>
> Joan.
>
>
>
>
>
> CookieSpec selected: best-match
>
> Cookie [version: 1][name: testName][value: testValue][domain:
> wstest.rhodasol.es][path: /wsserhs/rhodasol][expiry: Wed Jul 08 16:22:39
> CEST 2009] match [wstest.rhodasol.es:81/wsserhs/rhodasol]
>
>
>
> Sending request: POST /wsserhs/rhodasol HTTP/1.1
>
> POST /wsserhs/rhodasol HTTP/1.1
>
> Accept-Encoding: gzip
>
> Content-Length: 444
>
> Content-Type: text/xml
>
> Host: wstest.rhodasol.es:81
>
> Connection: Keep-Alive
>
> Cookie: $Version=1; testName="testValue"; $Path="/wsserhs/rhodasol";
> $Domain="wstest.rhodasol.es"
>
> Cookie2: $Version=1
>
> Receiving response: HTTP/1.1 200 OK
>
> HTTP/1.1 200 OK
>
>
I am sorry, Joan, but I see nothing wrong with the cookie. The cookie
looks perfectly valid to me.
Oleg
---------------------------------------------------------------------
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]