- 1 Copy one side of the exchange
From DevTools: request Headers → Cookie, or response Headers → Set-Cookie. From a HAR, copy those header values only.
- 2 Convert to JSON Array
Paste below. Set-Cookie keeps Domain and flags. A Cookie header will warn and use
localhost. - 3 Import or replay
JSON → CookieMan Import. Netscape → curl. Header String → Axios/httpie. Match the artefact to the consumer.
Side-by-side attributes
| Attribute | Cookie: request | Set-Cookie: response |
|---|---|---|
| name=value | Repeated, semicolon-separated | First pair on the line |
| Domain / Path | Absent | Parsed; Domain gets a leading dot if missing |
| Expires / Max-Age | Absent (session) | Unix seconds; Max-Age is now + N |
| Secure / HttpOnly / SameSite | Absent | Parsed |
| Partitioned | Absent | Token recognized, partition key not stored |
Quoted values with ; inside | Splitter respects quotes | Same splitter |
/^set-cookie:/im or contains Domain=/Path=/Expires=/HttpOnly/Secure/SameSite=, it is treated as Set-Cookie. A plain a=1; b=2 is a header string. Max-Age is computed at parse time
Max-Age=3600 becomes expirationDate = floor(now/1000) + 3600. The JSON you download is not a portable encoding of Max-Age; it is a snapshot. Re-parse later and the absolute expiry is what it is. Expires is an absolute HTTP date and does not move.
Set-Cookie: sid=abc; Domain=example.com; Max-Age=3600; Secure; HttpOnly
Cookie: sid=abc