What cookie file formats are there and how do I convert them?
Published December 5, 2026 · Updated December 5, 2026 · Mirage Browser
There are three common formats: the Netscape cookies.txt used by curl and wget, a JSON array exported by browser extensions and Playwright, and Base64, which is one of those encoded as text. They store the same fields with different names. Most failed imports come from wrong domains, expiry in the wrong unit, or a missing secure flag.
What does a cookie consist of?
A name and a value, plus rules set by the Set-Cookie header: the domain and path it is sent to, when it expires, whether it travels only over HTTPS (Secure), whether page scripts can read it (HttpOnly) and when it goes with requests from other sites (SameSite). Every file format stores these fields; they just name them differently.
What does the Netscape format look like?
One cookie per line, seven fields separated by tabs. curl reads and writes this format, and many exporters use it:
# Netscape HTTP Cookie File
.example.com TRUE / TRUE 1798761600 session abc123The fields are domain, whether subdomains match, path, secure, expiry in Unix seconds, name and value. A line starting with #HttpOnly_ marks an HttpOnly cookie.
What does the JSON format look like?
An array of objects. Field names differ between tools, which is where most trouble starts:
[
{ "name": "session", "value": "abc123", "domain": ".example.com", "path": "/",
"expires": 1798761600, "secure": true, "httpOnly": true, "sameSite": "Lax" }
]Some exporters write expirationDate instead of expires, some use milliseconds, and some write sameSite as no_restriction or unspecified.
Why do imports fail?
| Symptom | Usual cause |
|---|---|
| Cookie imported but the site asks to sign in | Domain without the leading dot, or the wrong subdomain |
| Cookie expired at once | Expiry in milliseconds read as seconds, or the reverse |
| Cookie ignored | SameSite=None without Secure, which browsers reject |
| Only some cookies work | Session cookies without an expiry were dropped by the exporter |
A good importer recognizes the format by itself, normalizes the fields and reports skipped records instead of failing silently.
How do I move cookies into many profiles?
- Export one file per account and name it after the profile:
Client A.json. - In Mirage select the profiles and choose More › Import cookies…, then drop all files at once. Each goes to the profile with the matching name.
- Choose whether to add to existing cookies or replace them, and read the count of skipped records.
From a script:
mirage cookies import "Client A" cookies.json
mirage cookies export "Client A" --format netscape -o client-a.txtAre cookie files dangerous?
A session cookie works like a password: whoever holds it is signed in. Do not send cookie files through chats, store them encrypted and delete them after the import. To move a whole profile with its device and data, an encrypted profile export is safer than loose cookie files.
More: extensions, cookies and passwords and browser profiles vs incognito.