symfony/symfony — Issue #3109: [BrowserKit] CookieJar can't parse multiple cookies from Set-Cookie
Author: asm89
Created: 2012-01-13 11:27:42+00:00
State: open

`CookieJar::updateFromResponse()` assumes that each `Set-Cookie` header contains only one cookie:
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/BrowserKit/CookieJar.php#L97

This is wrong since the following is a valid header defining three cookies (foo=1, bar=2, PHPSESSID=id):
`Set-Cookie: foo=1; expires=Fri, 13 Jan 2012 11:04:36 GMT; domain=.example.org, bar=2; expires=Fri, 13 Jan 2012 11:04:36 GMT; domain=.example.org, PHPSESSID=id; expires=Fri, 13 Jan 2012 11:04:36 GMT`

Another error is that this header is parsed to a cookie `foo` with domain `example.org, bar=2`.