3 min read

JSON Array vs cookies.txt: every field that is lost

JSON Array vs cookies.txt is a lossy conversion: seven tab-separated Netscape columns cannot hold sameSite or partitionKey. Use the converter below to see the rewritten file, then keep JSON when Chrome has to re-import the same flags.

Pick JSON Array for backups and browser import. Pick Netscape only for curl, wget, yt-dlp and MozillaCookieJar.

JSON vs cookies.txtcookies.txt field mappingJSON Array Netscapecookie format comparison
  1. 1
    Start from JSON Array

    Export from CookieMan with JSON Array — the only lossless format among the six.

  2. 2
    Convert both ways here

    Paste JSON, output Netscape, inspect the table below against the file. Paste the Netscape back with output JSON to see sameSite become unspecified.

  3. 3
    Choose the consumer

    Chrome Import → keep JSON. curl -b → keep Netscape. Do not round-trip through Netscape if SameSite matters.

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

Field-by-field mapping

What survives JSON Array ⇄ Netscape

JSON ArrayNetscapeRound-trip?
name, valuecolumns 6–7Yes
domaincolumn 1 (optional #HttpOnly_ prefix)Yes
hostOnlycolumn 2 inverted (FALSE = host-only)Yes
pathcolumn 3Yes
securecolumn 4 TRUE/FALSEYes
expirationDate secondscolumn 5; session → 0Yes, if not milliseconds
httpOnly#HttpOnly_ prefixYes with a prefix-aware reader
sameSitenoneNo — always unspecified after Netscape
partitionKey.topLevelSitenoneNo
url (derived)noneRebuilt from domain/path/secure
A round-trip JSON → Netscape → JSON is not identity. SameSite and CHIPS keys are gone. That is a format limit, not a UI bug.

When each format wins

  • JSON Array — Chrome import, backups, Playwright/Puppeteer fixtures that need SameSite.
  • Netscape — curl, wget, yt-dlp, Requests MozillaCookieJar.
  • Never Netscape — partitioned cookies, SameSite=None that must stick in Chrome.

Questions people ask

Is cookies.txt lossless if I only have name and value?
Name, value, domain, path, secure, host-only, expiry and HttpOnly (via prefix) survive. Everything else does not. Most “simple” cookies look fine; auth cookies often need SameSite.
Why does column 2 look inverted from hostOnly?
Netscape stores include-subdomains. TRUE means not host-only. CookieMan JSON stores hostOnly directly.
Which format should I commit to a test repo?
JSON Array with fake values, never live sessions. If the test runner is curl, generate Netscape in CI from that JSON.
3 min read

SameSite Lost in cookies.txt Exports

Netscape cookies.txt has no SameSite column. JSON → Netscape → JSON always yields unspecified. Keep JSON Array when Lax, Strict or None must survive Chrome import.

SameSite cookies.txtSameSite Netscape Open the guide
3 min read

JSON Map vs JSON Array Cookie Export

A JSON map is name→value only. CookieMan fills domain=localhost, path=/, session=true and warns. Use JSON Array when you need to import into Chrome.

JSON map cookiesJSON array vs map 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