tough-cookie.cookiejar.getcookiestring_2.md

July 9, 2025 ยท View on GitHub

Home > tough-cookie > CookieJar > getCookieString

CookieJar.getCookieString() method

Accepts the same options as .getCookies() but returns a string suitable for a Cookie header rather than an Array.

Signature:

getCookieString(url: string, options?: GetCookiesOptions): Promise<string>;

Parameters

Parameter

Type

Description

url

string

The domain to store the cookie with.

options

GetCookiesOptions

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

Returns:

Promise<string>