tough-cookie.cookiejar.getcookies_3.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 | URL, options?: GetCookiesOptions): Promise<Cookie[]>;

Parameters

Parameter

Type

Description

url

string | URL

The domain to store the cookie with.

options

GetCookiesOptions

(Optional) Configuration settings to use when retrieving the cookies.

Returns:

Promise<Cookie[]>

Remarks