How-to · Privacy

How to extract cookies from Chrome as a JSON file

CookieVault2 min de lectura

La respuesta corta

Chrome has no export button — DevTools only shows cookies, and document.cookie can't even see HttpOnly ones. A dedicated cookie manager extracts every cookie for a site into a JSON file in one click, and imports it back on another machine or profile. Treat the file like a password: exported session cookies are live logins.

  1. 1

    Open the site whose cookies you want to extract, then click the CookieVault Editor icon.

  2. 2

    Optionally filter with search-as-you-type so only the cookies you need are visible.

  3. 3

    Click export — all visible cookies are saved as a cookievault/v1 JSON file, HttpOnly ones included.

  4. 4

    On the target machine or profile, drag the JSON file into the Editor popup to import; EditThisCookie legacy exports load as-is.

  5. 5

    Delete the JSON file once it has served its purpose — exported session cookies are live credentials.

Sooner or later you need cookies out of the browser: to reproduce a bug on a colleague's machine, to move a hard-won session between Chrome profiles, to feed an HTTP client or a test runner, or just to snapshot state before you clear everything. Chrome offers no way to do this. DevTools → Application → Cookies displays them but has no export button, and reading document.cookie in the console misses every cookie flagged HttpOnly — which, for sessions, is usually the one you actually need.

Extract with a cookie manager

CookieVault Editor — our MV3-native, MIT-licensed cookie manager — does this in one click. Open the site, click the extension icon, and every cookie for that site is listed by domain. Use search to narrow the list if you only want some of them, then hit export: all visible cookies land in a tidy JSON file. Because the Editor works through Chrome's cookies API rather than page scripts, HttpOnly cookies are included, flags and expiry intact.

What's in the file

The export is CookieVault's cookievault/v1 format: a plain JSON document carrying each cookie's name, value, domain, path, expiry and its SameSite / Secure / HttpOnly flags. It's deliberately human-readable — you can diff two exports to see what a login flow changed, or post-process it with jq into whatever shape your script needs.

Import it anywhere

On the destination machine or profile, drag the JSON file into the Editor popup and the cookies are written back through the cookies API, flags and all. Import accepts two formats: cookievault/v1 and EditThisCookie's legacy bare-array export, so JSON files you saved from EditThisCookie years ago restore with no conversion step. If a value needs adjusting after import, everything is editable inline — see how to view and edit cookies in Chrome.

Handle the file like a credential

Be clear-eyed about what you just created: an exported session cookie is the login. Anyone holding the file can replay it until the cookie expires or the session is revoked. So extract only what the task needs, prefer sharing exports of test accounts rather than real ones, delete the file when you're done, and never commit one to a repository. The Editor itself keeps everything local — it makes no network requests and has no telemetry, so the only copy of your cookies is the one you deliberately saved.

Keeping the jar clean afterwards

Extraction pairs naturally with cleanup: once the state you care about is safely in a file, you can let an automatic cleaner delete everything you didn't whitelist — see auto-delete cookies except a whitelist in Chrome.

Cookies in, cookies out — as clean JSON

One-click extract of every cookie including HttpOnly, drag-and-drop import, EditThisCookie compatibility — local-only and open source.

See CookieVault →