3 min read

SameSite is dropped when you export cookies.txt

SameSite is lost in cookies.txt because the Netscape format has seven fields and no eighth for Lax, Strict or None. Convert JSON to Netscape below and back: sameSite becomes unspecified.

curl does not need the attribute to send the cookie. Chrome does, if the site set SameSite=None; Secure or Strict. Pick the format for the consumer, not for aesthetics.

SameSite cookies.txtSameSite NetscapeSameSite lost exportSameSite JSON
  1. 1
    Export JSON from Chrome

    CookieMan JSON Array includes sameSite as lax, strict, no_restriction or unspecified.

  2. 2
    Prove the loss in the converter

    Paste JSON, output Netscape, copy the file, paste it back with output JSON. The objects no longer have a useful SameSite.

  3. 3
    Keep JSON for Chrome, Netscape for curl

    If the next hop is CookieMan Import, never pass through Netscape. If the next hop is curl, the loss does not matter on the CLI.

Cookies are credentials. Conversion stays in this page — delete the file when you are done.

How CookieMan stores SameSite

On the wire / in UIJSON sameSiteAfter Netscape round-trip
Laxlaxunspecified
Strictstrictunspecified
Noneno_restrictionunspecified
(browser default)unspecifiedunspecified
SameSite=None still requires Secure when you import JSON into Chrome. Netscape cannot record either fact together. See SameSite=None without Secure.

What cookies.txt cannot do

  • Store SameSite.
  • Store CHIPS partition keys.
  • Store an HttpOnly flag except via the #HttpOnly_ prefix hack.
  • Store millisecond precision — timestamps are Unix seconds.
            {
  "name": "session_id",
  "sameSite": "no_restriction",
  "secure": true
}
# Netscape export has no place for no_restriction
          

Questions people ask

Will Chrome treat unspecified like Lax?
Modern Chrome defaults unspecified cookies toward Lax-like behaviour for cross-site writes. That is not the same as restoring an explicit None. Do not round-trip None through Netscape.
Does Set-Cookie keep SameSite?
Yes. Set-Cookie serialisation writes SameSite=Lax|Strict|None. Use that or JSON when the attribute matters.
Why does curl still work without SameSite?
curl is not a browser. It sends the cookie for the matching domain without SameSite policy. The file is fine for CLI and insufficient for Chrome.
3 min read

JSON Array vs cookies.txt Field Mapping

Side-by-side mapping of CookieMan JSON Array fields to Netscape cookies.txt. SameSite, partitionKey and store metadata never survive the seven-column file.

JSON vs cookies.txtcookies.txt field mapping Open the guide
3 min read

Fix SameSite=None Without Secure

Chrome rejects SameSite=None unless Secure is set. The converter will not override the browser. Paste JSON, set secure true, then import on HTTPS.

SameSite=None without SecureSameSite None rejected Open the guide
3 min read

curl -b cookies.txt from JSON Export

Turn a Chrome JSON export into the Netscape file curl -b and -c expect: tabs, #HttpOnly_ prefixes, Unix-second expiry and a trailing newline.

curl cookies.txtcurl -b cookies Open the guide

Apply this on live cookies

The converter rewrites files. The extension reads and writes the jar in Chrome, including HttpOnly cookies.

Free and MIT-licensed · Chrome, Edge and other Chromium browsers · Nothing leaves your machine