symfony/symfony — pull request #3823 by jakzal (2012-04-07 17:40:08+00:00)
Title: [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookie

...s from Set-Cookie.

My fix splits value of *Set-Cookie* header by comma. Than it checks each extracted part if it starts with a cookie-name (token). If check is positive cookie is added to the list. Otherwise it's appended to the previous value. First element is always added to the list.

[rfc6265](http://tools.ietf.org/html/rfc6265) defines cookie-name with token:

cookie-name = token
token =

token is defined in [rfc2616](http://tools.ietf.org/html/rfc2616#section-2.2) as follows:

token = 1*
CHAR =
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT

That means cookie-name can be built out of following set of characters: *! # $ % & ' * + - . ^ _ ` | ~ 0-9 A-Z a-z*