tough-cookie.cookiejar.getcookies.md
July 9, 2025 ยท View on GitHub
Home > tough-cookie > CookieJar > getCookies
CookieJar.getCookies() method
Retrieve the list of cookies that can be sent in a Cookie header for the current URL.
Signature:
getCookies(url: string): Promise<Cookie[]>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
url |
string |
The domain to store the cookie with. |
Returns:
Promise<Cookie[]>
Remarks
-
The array of cookies returned will be sorted according to cookieCompare().
-
The Cookie.lastAccessed property will be updated on all returned cookies.