tough-cookie.cookiejar.getcookiestringsync.md

July 9, 2025 ยท View on GitHub

Home > tough-cookie > CookieJar > getCookieStringSync

CookieJar.getCookieStringSync() method

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

Note: Only works if the configured Store is also synchronous.

Signature:

getCookieStringSync(url: string, options?: GetCookiesOptions): 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:

string