[
https://issues.apache.org/jira/browse/HTTPCLIENT-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13584207#comment-13584207
]
Oleg Kalnichevski commented on HTTPCLIENT-1327:
-----------------------------------------------
// Need to parse the header again, because Netscape style cookies do not
correctly
// support multiple header elements (comma cannot be treated as an element
separator)
By my standards that is hell a lot of comment ;) I cannot say what browsers do
in this regard, but BrowserCompatSpec has to use a different header element
parsing routine that does not treat comma as a header element separator.
Without this logic the spec parser would produce two cookies instead of one
'test="test"; Version=1; Max-Age=1000; Expires=Mon' and '11-Feb-2013 10:39:19
GMT; Path=/ '
Oleg
> BrowserCompatSpec double quotes cookie value when cookie has "expires"
> attribute
> --------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1327
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1327
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.3 Alpha1
> Reporter: Francois-Xavier Bonnet
> Priority: Minor
>
> When receiving this header:
> Set-Cookie: test="test"; Version=1; Max-Age=1000; Expires=Mon, 11-Feb-2013
> 10:39:19 GMT; Path=/
> If you parse and format again the cookie you get:
> Cookie: test="\"test\""
> I tested with the last versions of Firefox, Chrome and Internet Explorer and
> you always get:
> Cookie: test="test"
> You can easily get such a cookie with Tomcat:
> Cookie tomcatCookie = new Cookie("test", "test");
> tomcatCookie.setPath("/");
> tomcatCookie.setMaxAge(1000);
> response.addCookie(tomcatCookie);
> The problem is that BrowserCompatSpec considers it as a Netscape style cookie
> because of expires attribute so the quotes are considered as being part of
> the value.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]