---
title: "tough-cookie 6.1.0 Breaking Changes on npm | Since.dev"
description: "What each tough-cookie release removed, renamed or changed: 94 breaking changes in 6 versions on npm, each with its source."
canonical_url: https://since.dev/packages/npm/tough-cookie
last_updated: 2026-12-04
---

# tough-cookie breaking changes

tough-cookie 6.1.0 (November 6, 2026) is its newest release with breaking changes, 13 of them. The first: Behavior changed Cookie.toString. Every breaking API change we have recorded in tough-cookie on npm: 94 breaking changes in 6 versions. Below, its 6 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `6.1.0`, released November 6, 2026. [Source repository](https://github.com/salesforce/tough-cookie)

Packages on npm run on Node.js. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

- From [5.1.1](#v-5-1-1) to [6.1.0](#v-6-1-0): 14 breaking changes in 2 versions.
- From [4.0.0](#v-4-0-0) to [6.1.0](#v-6-1-0): 92 breaking changes in 5 versions.

## tough-cookie 6.1.0 breaking changes

tough-cookie 6.1.0, released November 6, 2026: 13 breaking changes.

- **Behavior changed** `Cookie.toString`  

An explicit SameSite=None is now preserved in Cookie.toString() and getSetCookieStrings() output instead of being dropped. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v6.1.0)
- **Behavior changed** `Cookie.validate`  

Cookie.validate() now returns false for empty, separator-containing, control-character or non-ASCII names. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v6.1.0)
- **Behavior changed** `CookieJar`  

CookieJar now refuses to store Secure cookies set from non-trustworthy origins such as plain http. To keep the old behavior, pass enforceSecureOriginOnStorage: false. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v6.1.0)
- **Behavior changed** `Domain attribute`  

An IPv4 address in the Domain attribute is accepted rather than treated as a public suffix. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v6.1.0)
- **Signature changed** `Cookie.sameSiteCanonical`  

Was static sameSiteCanonical: {readonly strict: "Strict"; readonly lax: "Lax";}; now static sameSiteCanonical: {readonly strict: "Strict"; readonly lax: "Lax"; readonly none: "None";}. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.getCookies`  

Was getCookies(url: string): Promise\<Cookie\[\]> getCookies(url: string, callback: Callback\<Cookie\[\]>): void; now getCookies(url: string | URL, callback: Callback\<Cookie\[\]>): void. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.getCookiesSync`  

Was getCookiesSync(url: string, options?: GetCookiesOptions): Cookie\[\]; now getCookiesSync(url: string | URL, options?: GetCookiesOptions): Cookie\[\]. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.getCookieString`  

Was getCookieString(url: string, callback: Callback\<string | undefined>): void getCookieString(url: string, options: GetCookiesOptions | Callback\<string | undefined>, callback?: Callback\<string | undefined>): unknown getCookieString(url... [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.getCookieStringSync`  

Was getCookieStringSync(url: string, options?: GetCookiesOptions): string; now getCookieStringSync(url: string | URL, options?: GetCookiesOptions): string. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.getSetCookieStrings`  

Was getSetCookieStrings(url: string, callback: Callback\<string\[\] | undefined>): void getSetCookieStrings(url: string, options: GetCookiesOptions, callback: Callback\<string\[\] | undefined>): void getSetCookieStrings(url: string, options... [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.getSetCookieStringsSync`  

Was getSetCookieStringsSync(url: string, options?: GetCookiesOptions): string\[\]; now getSetCookieStringsSync(url: string | URL, options?: GetCookiesOptions): string\[\]. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CookieJar.setCookieSync`  

Was setCookieSync(cookie: string | Cookie, url: string, options?: SetCookieOptions): Cookie | undefined; now setCookieSync(cookie: string | Cookie, url: string | URL, options?: SetCookieOptions): Cookie | undefined. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)
- **Signature changed** `CreateCookieJarOptions.prefixSecurity`  

Was prefixSecurity?: 'strict' | 'silent' | 'unsafe-disabled' | undefined; now prefixSecurity?: PrefixSecurityMode | undefined. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/6.1.0)

## tough-cookie 6.0.0 breaking changes

tough-cookie 6.0.0, released August 14, 2025: 1 breaking change.

- **Behavior changed**  

Cookies on localhost over http are now considered secure by default, which can change how existing code behaves. Check the cookie jar options documentation to configure this behavior. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v6.0.0)

## tough-cookie 5.1.1 breaking changes

tough-cookie 5.1.1, released February 7, 2025: 1 breaking change.

- **Signature changed** `PrefixSecurityEnum`  

Was const PrefixSecurityEnum: Readonly<{SILENT: "silent"; STRICT: "strict"; DISABLED: "unsafe-disabled";}>; now const PrefixSecurityEnum: {readonly SILENT: "silent"; readonly STRICT: "strict"; readonly DISABLED: "unsafe-disabled";}. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.1.1)

## tough-cookie 5.1.0 breaking changes

tough-cookie 5.1.0, released January 9, 2025: 2 breaking changes.

- **Behavior changed**  

Cookies whose expiry is epoch time 0 are now removed instead of kept. Check code that relies on such cookies persisting. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v5.1.0)
- **Signature changed** `CookieJar.getCookies`  

Was getCookies(url: string | URL, options?: GetCookiesOptions | undefined): Promise\<Cookie\[\]>; now getCookies(url: string | URL, options?: GetCookiesOptions): Promise\<Cookie\[\]>. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.1.0)

## tough-cookie 5.0.0 breaking changes

tough-cookie 5.0.0, released September 9, 2024: 75 breaking changes.

- **Removed**  

Official support for non-Node environments has ended; code relying on them may behave differently. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v5.0.0)
- **Removed**  

The package now requires Node.js 18 or later; users on older Node versions must upgrade. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v5.0.0)
- **Removed** `Cookie.expiryDate`  

Cookie.expiryDate was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `Cookie.inspect`  

Use node's util.inspect.custom symbol instead; cookies may print differently in non-node environments. [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `Cookie.ParseOptions`  

Cookie.ParseOptions was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `Cookie.Properties`  

Cookie.Properties was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `Cookie.Serialized`  

Cookie.Serialized was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `CookieJar.GetCookiesOptions`  

CookieJar.GetCookiesOptions was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `CookieJar.Options`  

CookieJar.Options was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)
- **Removed** `CookieJar.Serialized`  

CookieJar.Serialized was removed in tough-cookie 5.0.0 [npmjs.com](https://www.npmjs.com/package/tough-cookie/v/5.0.0)

And 65 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## tough-cookie 4.0.0 breaking changes

tough-cookie 4.0.0, released March 19, 2020: 2 breaking changes.

- **Behavior changed**  

Classes are now defined with class syntax instead of function prototypes. Code that uses .call() to inherit from these classes may break. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v4.0.0)
- **Signature changed** `findCookies`  

The callback parameter of findCookies() must now be the last argument. Update calls that pass the callback first. [github.com](https://github.com/salesforce/tough-cookie/releases/tag/v4.0.0)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
