# salesforce/tough-cookie

RFC6265 Cookies and CookieJar for Node.js

Repository: https://github.com/salesforce/tough-cookie
Canonical: https://ross.abutalabs.com/products/tough-cookie
Language: TypeScript
License: BSD-3-Clause
License Family: permissive
Last push: 2026-08-14T18:03:30+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 68, longevity 100
- inputs: {"age_days": 5432, "days_push": 19, "days_rel": 57, "gap_med": 118.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1064, forks 299 (observed 2026-08-28T04:03:26.633901+00:00)

## What it is
Tough Cookie is a Node.js library implementing RFC6265 (and RFC6265bis features like SameSite and cookie prefixes) for parsing, storing, and retrieving HTTP cookies. It provides Cookie and CookieJar classes with pluggable storage, used widely by HTTP clients and scrapers.

## Use cases
- parse and generate Set-Cookie headers in node
- manage a cookie jar across http requests
- handle SameSite cookie rules for scraping
- persist cookies between requests in an http client
- implement RFC6265 cookie handling in typescript

## When to choose
- you need standards-compliant cookie parsing and storage in Node.js
- you're building an HTTP client, scraper, or test tool that must track cookies
- you need SameSite or cookie-prefix support

## When to avoid
- you only need browser cookie handling (browsers do this natively)
- you need cookie management outside Node.js
- you want a full HTTP client rather than just cookie logic

## Facets
- artifact type: library
- maturity: active
- function: http-client, serialization, security
- domain: web-development, developer-tools, security
- platform: -
- tags: cookies, rfc6265, cookiejar, http-headers, set-cookie, samesite, nodejs, javascript

## Member repositories
- salesforce/tough-cookie (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:26.633901+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:56:06.386892+00:00, confidence not recorded.
  - readme: https://github.com/salesforce/tough-cookie (fetched 2026-08-28T04:03:26.633901+00:00, sha 73bec9d20ce1)
  - registry_npm: https://registry.npmjs.org/tough-cookie (fetched 2026-08-29T12:57:49.737664+00:00, sha d3261465d5c0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
