3 min read

Convert HAR Set-Cookie headers to JSON cookies

HAR files store Set-Cookie response headers, not a CookieMan JSON array — copy those lines out of DevTools or a proxy export and paste them here to build importable JSON. The detector does not walk log.entries[].response.headers for you.

That limitation is deliberate: a HAR also contains URLs, bodies and tokens you should not upload anywhere. Paste only the Set-Cookie lines you need.

HAR Set-CookieHAR cookies to JSONSet-Cookie to JSONDevTools HAR cookies
  1. 1
    Extract Set-Cookie lines

    In Chrome DevTools Network, select the response, copy each Set-Cookie header, or open the HAR and copy the header values. One cookie per line, with or without the Set-Cookie: prefix.

  2. 2
    Convert on this page

    Paste the lines. Detection is Set-Cookie. Output JSON Array keeps Domain, Path, Secure, HttpOnly, SameSite and Expires/Max-Age.

  3. 3
    Import or replay

    Import in CookieMan on the host that issued the cookies, or switch output to Netscape for curl. Do not commit the HAR.

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

Set-Cookie attributeJSON fieldParser behaviour
name=value (first pair)name, valueRequired
Domain=domain, hostOnly: falseA leading dot is added if missing
Path=pathDefaults to /
Expires=expirationDateParsed as a HTTP date, stored as Unix seconds
Max-Age=expirationDateNow + seconds (computed at parse time)
Secure / HttpOnlybooleansPresence flags
SameSite=None|Lax|StrictsameSiteNoneno_restriction
PartitionedRecognized and ignored — no topLevelSite in the header
The Partitioned attribute without a partition key cannot be stored. CHIPS cookies copied as Set-Cookie will import unpartitioned and may not be sent in the third-party context you expect. Use CookieMan’s JSON export from the live jar instead — partitioned cookie export.

Why the whole HAR is rejected

A HAR is JSON, but it is not a cookie array and not a name→value map of cookies. Pasting the file yields Could not detect cookie format or a JSON map of unrelated keys. That is the same message as any unknown blob — fix detection errors. Copy Set-Cookie lines only.

            Set-Cookie: session_id=abc123; Domain=.example.com; Path=/; Secure; HttpOnly; SameSite=Lax
Set-Cookie: theme=dark; Domain=.example.com; Path=/; SameSite=Lax
          

Questions people ask

Can I drop a .har file into the converter?
No. Extract Set-Cookie header values. The tool parses cookie formats, not HTTP Archive documents.
Max-Age or Expires — which wins?
If both appear on one line, both are applied in order; Max-Age overwrites expirationDate because it is parsed later. Prefer one.
Are request Cookie headers in the HAR usable?
Yes, but they lose attributes. Prefer response Set-Cookie. See Postman Cookie header to JSON for the header-only path.
3 min read

Cookie Header vs Set-Cookie Conversion

A Cookie request header is name=value pairs. Set-Cookie response lines carry Domain, Path, flags and Expires. Convert each separately — they are not interchangeable.

Cookie vs Set-CookieSet-Cookie to JSON Open the guide
3 min read

Postman Cookie Header to JSON

Paste a Postman Cookie header and turn name=value pairs into a JSON array. Domains default to localhost until you set them — then import or send via curl.

Postman cookiesPostman Cookie header Open the guide
3 min read

Export Partitioned CHIPS Cookies

Partitioned cookies need JSON Array with partitionKey.topLevelSite. Netscape, headers and Set-Cookie drop the key, so Chrome stores the wrong partition.

CHIPS cookiespartitioned cookie export 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