parse
parse(
cookie?,options?):object
Defined in: lib/cookie/parse.js:65
Parses a Cookie header string into a key-value map.
Parameters
Section titled “Parameters”cookie?
Section titled “cookie?”string = ''
Raw value of the Cookie HTTP header
options?
Section titled “options?”Parser configuration
collection?
Section titled “collection?”boolean = true
Aggregate duplicate names into arrays
decoder?
Section titled “decoder?”Function = ...
Transform applied to each [name, value] pair
loose?
Section titled “loose?”boolean = false
Use RFC 2109 (lenient) instead of RFC 6265 (strict) parsing
number = 50
Maximum number of cookies; throws on excess
Returns
Section titled “Returns”object
- Plain object of cookie name → value (or string[])
Throws
Section titled “Throws”If max is exceeded