Optional
store: StoreFetches all cookies and organizes them by URL.
This method serializes cookies and groups them by their domain and path, constructing a URL as the key and an object of cookies as key-value pairs.
An object where keys are URLs and values are objects containing cookies as key-value pairs.
{
* "https://example.com/": {
* "cookie1": "value1",
* "cookie2": "value2"
* },
* "https://anotherdomain.com/": {
* "cookieA": "valueA",
* "cookieB": "valueB"
* }
* }
Fetches the cookies for a given URL as an array of objects. Each object contains the name and value of a cookie.
The URL from which cookies are to be fetched.
An array of objects, each containing the name and value of a cookie.
fetchSequence('http://example.com')
Optional
options: GetCookiesOptionsOptional
options: GetCookiesOptionsOptional
options: GetCookiesOptionsMerges the provided cookies with the existing cookies for a given URL according to request payload.
An object containing cookies as key-value pairs.
The URL for which cookies are to be set.
An array of objects, each containing the name and value of a cookie.
merge({ 'cookie1': 'value1', 'cookie2': 'value2' }, 'http://example.com')
Optional
options: SetCookieOptionsChecks and sets cookies for a given URL.
An object containing cookies as key-value pairs.
The URL for which cookies are to be set.
An object containing cookies as key-value pairs.
check({ 'cookie1': 'value1', 'cookie2': 'value2' }, 'http://example.com')
Static
deserializeOptional
store: StoreStatic
deserializeStatic
fromJSON
Cookies class extends the CookieJar class from the "tough-cookie" library. It provides methods to manage cookies for a specific URL.