tough-cookie.cookiejar.fromjson.md
July 9, 2025 ยท View on GitHub
Home > tough-cookie > CookieJar > fromJSON
CookieJar.fromJSON() method
Alias of CookieJar.deserializeSync().
Signature:
static fromJSON(jsonString: string | SerializedCookieJar, store?: Store): CookieJar;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
jsonString |
string | SerializedCookieJar |
A JSON string or object representing the deserialized cookies. |
|
store |
(Optional) The underlying store to persist the deserialized cookies into. |
Returns:
Remarks
-
When no Store is provided, a new MemoryCookieStore will be used.
-
As a convenience, if
strOrObjis a string, it is passed throughJSON.parsefirst.