Skip to content

Latest commit

 

History

History
73 lines (35 loc) · 980 Bytes

tough-cookie.parse.md

File metadata and controls

73 lines (35 loc) · 980 Bytes

Home > tough-cookie > parse

parse() function

Parses a string into a Cookie object.

Signature:

export declare function parse(str: string, options?: ParseCookieOptions): Cookie | undefined;

Parameters

Parameter

Type

Description

str

string

The Set-Cookie header or a Cookie string to parse.

options

ParseCookieOptions

(Optional) Configures strict or loose mode for cookie parsing

**Returns:**

Cookie | undefined

Remarks

Note: when parsing a Cookie header it must be split by ';' before each Cookie string can be parsed.