When parsing a cookie string the ',' character is special because it is used in the...
commit79f02e7dbd28f3a60deeb083afb3c74a14430a88
authorBenjamin C Meyer <benjamin.meyer@torchmobile.com>
Mon, 16 Mar 2009 18:05:22 +0000 (16 14:05 -0400)
committerPeter Hartmann <peter.hartmann@trolltech.com>
Mon, 30 Mar 2009 15:44:22 +0000 (30 17:44 +0200)
treeb14bb63e6a26cfc8c046a9e8f0fb098023de9727
parentfe6f08387f726d45536c13c00604b8290237af51
When parsing a cookie string the ',' character is special because it is used in the date and to differentiate between multiple cookies. When there are multiple set-cookie headers rather then combining them with ', ' use '\n' like Firefox because we are 100% sure that we have multiple cookies and using , can result in cases where the , is interpreted as as part of the date such as the following

set-cookie:a=b; expires=2009 mar 10
set-cookie:c=d

Combined the old way they result in the second cookie being ignored

a=b; expires=2009 mar 10, c=d

Using '\n' moves our cookie parser closer to Firefox's algorithm which
will result in more behavior and bug for bug compatibility.
Attempting to be smarter about the , will result in incompatibility
with Firefox's implementation (as my first attempt at fixing this bug
resulted).

Also when parsing multiple cookies when we have an error
don't return an empty list of cookies, but return the list of
cookies we were able to parse successfully so far.

Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com>
Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
src/network/access/qnetworkaccesshttpbackend.cpp
src/network/access/qnetworkcookie.cpp