Parses a Cookie request header into a name→value record.
Values are percent-decoded, mirroring serializeCookie's encoding
so that the two round-trip. A value that is not valid percent-encoding is
returned verbatim rather than throwing, because a malformed cookie is a
client concern. Pairs without = are skipped, and when a name repeats the
first occurrence wins — browsers send the most specific cookie first.
Parameters
header: string|null|undefined
The raw Cookie header value; null/undefined when absent
Returns Record<string,string>
Parsed cookies, empty when the header is absent or holds no valid pairs
Parses a
Cookierequest header into a name→value record.Values are percent-decoded, mirroring
serializeCookie's encoding so that the two round-trip. A value that is not valid percent-encoding is returned verbatim rather than throwing, because a malformed cookie is a client concern. Pairs without=are skipped, and when a name repeats the first occurrence wins — browsers send the most specific cookie first.