CookieParser is used to parse the cookie header. The cookie header is one of the headers that is used by the HTTP state management mechanism. The Cookie header is the header that is sent from the client to the server in response to a Set-Cookie header. The syntax of the Cookie header as taken from RFC 2109, HTTP State Management Mechanism.
cookie = "Cookie:" cookie-version 1*((";" | ",") cookie-value) cookie-value = NAME "=" VALUE [";" path] [";" domain] cookie-version = "$Version" "=" value NAME = attr VALUE = value path = "$Path" "=" value domain = "$Domain" "=" value
The cookie header may consist of several cookies. Each cookie can be extracted from the header by examining the it syntax of the cookie header. The syntax of the cookie header is defined in RFC 2109.
Each cookie has a $Version
attribute followed by multiple cookies. Each contains a name and a value, followed by an optional $Path
and $Domain
attribute. This will parse a given cookie header and return each cookie extracted as a Cookie
object.
@author Niall Gallagher