hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Achim Westermann (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1212) SET-COOKIE header with RFC1036 Date cannot be parsed / is dropped
Date Wed, 04 Jul 2012 17:14:34 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406631#comment-13406631

Achim Westermann commented on HTTPCLIENT-1212:

Hi Oleg, 
that was a bit too quick I think. Those other cookie specs you mention won't work (for my
case) in all cases as the path handling is different. In my case I get a redirect from de.eso.tv
to login.eso.tv where I get a cookie. The RFC 2109 impl supports the subdomain cookie exchange.

RFC 2109 implementation has explicitly listed the dateformat of that cookie. That made me
think that this should work. 

Just on the surface: I did not find a ready-made cookie spec that would be able to handle
http://www.de.eso.tv (redirect-loop). On the other hand my browsers do manage to do it. 

kind regards, 
> SET-COOKIE header with RFC1036 Date cannot be parsed / is dropped
> -----------------------------------------------------------------
>                 Key: HTTPCLIENT-1212
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1212
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Linux version 3.2.0-3-amd64 (Debian 3.2.21-3) (debian-kernel@lists.debian.org)
(gcc version 4.6.3 (Debian 4.6.3-8) )
>            Reporter: Achim Westermann
> Problem: Server sends a cookie in RF-1036 date: 
> DEBUG [org.apache.http.wire] << "HTTP/1.0 301 Moved Permanently[\r][\n]"
> DEBUG [org.apache.http.wire] << "Server: Apache-Coyote/1.1[\r][\n]"
> DEBUG [org.apache.http.wire] << "X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1[\r][\n]"
> DEBUG [org.apache.http.wire] << "Set-Cookie: testcookie=test; Expires=Wed, 03-Jul-2013
13:39:50 GMT; Path=/[\r][\n]"
> DEBUG [org.apache.http.wire] << "P3P: CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi
> DEBUG [org.apache.http.wire] << "Location: http://de.eso.tv/wahrsager-hellseher[\r][\n]"
> DEBUG [org.apache.http.wire] << "Content-Length: 0[\r][\n]"
> DEBUG [org.apache.http.wire] << "Date: Tue, 03 Jul 2012 13:39:50 GMT[\r][\n]"
> DEBUG [org.apache.http.wire] << "X-Varnish: 1697680967[\r][\n]"
> DEBUG [org.apache.http.wire] << "Age: 0[\r][\n]"
> DEBUG [org.apache.http.wire] << "Via: 1.1 varnish[\r][\n]"
> DEBUG [org.apache.http.wire] << "X-Cache: MISS from dslrouter02.qintern.de[\r][\n]"
> DEBUG [org.apache.http.wire] << "X-Cache-Lookup: MISS from dslrouter02.qintern.de:3128[\r][\n]"
> DEBUG [org.apache.http.wire] << "Proxy-Connection: keep-alive[\r][\n]"
> DEBUG [org.apache.http.wire] << "[\r][\n]"
> The RFC2109Spec.java uses the DateUtils.PATTERN_RFC1036 in the default set for cookie
> Method RFC2109Spec.parse(Header, CookieOrigin), line 108 uses: header.getElements();
> This method sees the ',' as the delimiter between two header elements (BasicHeaderValueParser.,
line 162 (ELEM_DELIMITER). 
> Given the header: "Set-Cookie: testcookie=test; Expires=Wed, 03-Jul-2013 14:22:28 GMT;
> we end up with two HeaderElement instances: 
> 1. testcookie=test; Expires=Wed
> 2. 03-Jul-2013 14:22:28 GMT; Path=/ 
> Now back from httpcore to httpclient:CookieSpecBase.parse(HeaderElement[], CookieOrigin),
line 93: 
> This leads to BasicExpiresHandler.parse(SetCookie, String) being called with a value
"Wed" and to a MalformedCookieException. 
> For the big picture: httpclient sessions that have to send cookies (e.g. for preventing
redirect-loops) will not work with servers sending this date format. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message