- 1 Export JSON from the browser
Open the site in Chrome, export JSON Array from CookieMan (current site). You can also paste Set-Cookie lines; they will be detected.
- 2 Convert to Netscape on this page
Paste below. Output is cookies.txt. Confirm session cookies use expiry
0and HttpOnly lines start with#HttpOnly_. - 3 Call curl
Save the output as
cookies.txtand runcurl -b cookies.txt -c cookies.txt https://example.com/dashboard. Drop-cif you do not want the jar updated.
curl cookie flags versus this file
| Flag | Role | File requirement |
|---|---|---|
-b cookies.txt / --cookie | Send cookies | Netscape or name=value string |
-c cookies.txt / --cookie-jar | Write Set-Cookie back | Will rewrite the file in Netscape |
--junk-session-cookies | Drop expiry 0 on write | Do not use if you need session tokens |
-b "name=value" | Inline header, no file | No domain — fine for one host, not a jar |
curl -b cookies.txt -c cookies.txt https://example.com/dashboard
# inspect what curl wrote back
# HttpOnly cookies remain prefixed:
# #HttpOnly_.example.com TRUE / TRUE 0 session_id abc123
SameSite column. curl will still send the cookie on requests you make; Chrome may not if you re-import the jar. Keep JSON for browser import — SameSite lost in cookies.txt. What curl’s reader rejects
- Space-separated columns (tabs only) — repaired here if the TRUE/FALSE pattern is intact.
- 13-digit expiry — converted to seconds with a warning.
- JSON — curl will not parse a CookieMan array as a jar. Always export Netscape.