# How to import cookies into Chrome

> Chrome has no cookie import. Paste the file into a cookie extension's Import box, add single cookies in DevTools, or set them in a script.

Source: https://mosaicbrowser.com/guides/import-cookies-into-chrome

## How to import cookies into Chrome

Chrome cannot import a cookie file by itself. To import cookies into Chrome, open the site they belong to, paste the export into a cookie extension such as Cookie-Editor and press Import, then reload the page; DevTools can add cookies one at a time, and a script can set them through the DevTools protocol.

![Import cookies into Chrome, then reload, beside a screenshot: creating a profile in Mosaic: a checked proxy, and the hardware and locale drawn to match its IP](https://mosaicbrowser.com/covers/import-cookies-into-chrome.webp)

Chrome will pull bookmarks, passwords and history out of another browser ([Chrome Help](https://support.google.com/chrome/answer/96816?hl=en)). Hand it a cookie file and it has nowhere to put it. So to import cookies into Chrome you borrow something with permission to write them: a cookie extension, the Application panel in DevTools, or a script talking to the DevTools protocol. If the file came out of Cookie-Editor, the extension route takes about a minute.

All of this assumes the session is yours. Maybe you exported it from Firefox last night, or it is the QA account your team resets every Monday. Load a stranger's cookies and you are signed in as that stranger.

## How to import cookies into Chrome with an extension

1. From the Chrome Web Store, add Cookie-Editor (any cookie extension with an Import button works the same way).
2. Open the site the cookies came from, for example `https://mail.example.com`.
3. Click the Cookie-Editor icon and press Import.
4. Paste. JSON, a Netscape `cookies.txt` and a bare `name=value; name2=value2` header string are all accepted.
5. Confirm and reload.

Step 2 matters for one format only. JSON and Netscape lines carry a domain, and Cookie-Editor writes each cookie there whatever tab is open. A header string carries none, so it lands on the site in front of you.

Still looking at a sign-in form? Check the Application panel (below) before you blame the import.

Netscape files cause most of the trouble. Cookie-Editor tries a paste as JSON first, then as a header string, then as Netscape, and its Netscape reader cuts each line at the tab characters. Anything other than exactly seven pieces is rejected ([Cookie-Editor source](https://github.com/moustachauve/cookie-editor/blob/master/interface/lib/netscapeFormat.js)), and the popup says "The input is not in a valid format." Send a cookies.txt through Slack or paste it into a web form and the tabs often come back as spaces. Every value is still correct; the file still fails. Open it in an editor that shows tab characters, or ask whoever sent it for JSON. [The Netscape cookie format, explained](https://mosaicbrowser.com/guides/netscape-cookie-format-explained) has the seven columns in order.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Local first](https://mosaicbrowser.com/features/local-first)

## Add a cookie by hand in DevTools

One or two cookies need no extension at all. In DevTools, open Application › Storage › Cookies and click the site. Double-click the empty row at the bottom, type the name, Tab, the value, Enter. DevTools fills in domain, path and the rest, and you can double-click any of them except Size to change it ([Chrome DevTools docs](https://developer.chrome.com/docs/devtools/application/cookies)). A cookie with an invalid value turns red.

A real login is usually twenty or thirty cookies spread over three or four domains, so typing it in is a bad afternoon. The same table is where you confirm what an import really set.

## Set cookies from a script

In code, set them before the first `goto`. Playwright's `browserContext.addCookies()` wants a `url`, or a `domain` and a `path`, on every cookie; a domain that starts with a dot covers its subdomains too ([Playwright docs](https://playwright.dev/docs/api/class-browsercontext)). Anything else that speaks the DevTools protocol can call `Network.setCookie` or `Network.setCookies` directly ([CDP Network domain](https://chromedevtools.github.io/devtools-protocol/tot/Network/)).

## Why an imported cookie gets dropped

An imported cookie has to pass the checks Chrome runs on a `Set-Cookie` header. Three of them catch old exports. The first two come from [MDN's Set-Cookie reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie):

- `__Host-` cookies must be Secure, must have path `/`, and must not have a Domain attribute. An exporter that writes `.example.com` in the domain column breaks every one of them.
- `SameSite=None` without Secure is refused.
- Expired cookies are discarded, by curl as by browsers ([curl's cookie notes](https://curl.se/docs/http-cookies.html)). Export on the 1st, import on the 20th, and some of the jar is already gone.

Some logins never lived in cookies. If the token sits in local storage, a flawless cookie import still leaves you signed out, because local storage is not part of a cookie import.

## Importing cookies into a Mosaic profile

Mosaic profiles run on Tesseract Chrome, our own Chromium, and the import box is in the profile editor.

1. Open the profile and click its **Cookies** tab.
2. Paste into **Paste an export**: a JSON array from Cookie-Editor or EditThisCookie, a `{ "cookies": [...] }` wrapper, a Netscape `cookies.txt`, or a `name=value; name=value` header.
3. Press **Load cookies**, look over the table, save the profile.

![Creating a Mosaic profile: proxy, hardware and locale drawn to match its IP](https://mosaicbrowser.com/shots/profile-editor.png)
*The profile editor, where the Cookies tab lives*

We wrote that parser after hitting the failures above. A Netscape line is split on any run of whitespace, so the Slack-mangled file loads. `#HttpOnly_` lines are read as HttpOnly cookies, not skipped as comments. Paste a header string and a **Domain** field appears, with **Load cookies** greyed out until it is filled; without a domain the cookies would "import" and set nothing. A bad line is named, as in "Line 4 is not a Netscape cookie row."

Under the hood the cookies go in over DevTools, so Chromium stores them the same way it stores cookies from a real sign-in. On Pro the local API does the same job: `POST /profiles/:id/cookies` pushes them into a running profile with no restart, which is how a [Playwright script attached to a profile](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser) can begin already signed in. The jar is encrypted on disk and stays on your computer ([local first](https://mosaicbrowser.com/features/local-first)). For the other end of the trip, see [how to export cookies from Chrome](https://mosaicbrowser.com/guides/export-cookies-from-chrome).

## Sources

1. [Google Chrome Help: Import Chrome bookmarks & settings](https://support.google.com/chrome/answer/96816?hl=en), read November 2, 2026
2. [Cookie-Editor source: Netscape format](https://github.com/moustachauve/cookie-editor/blob/master/interface/lib/netscapeFormat.js), read November 2, 2026
3. [Chrome DevTools: View, add, edit, and delete cookies](https://developer.chrome.com/docs/devtools/application/cookies), read November 2, 2026
4. [Chrome Extensions: chrome.cookies API](https://developer.chrome.com/docs/extensions/reference/api/cookies), read November 2, 2026
5. [MDN: Set-Cookie](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie), read November 2, 2026
6. [Chrome DevTools Protocol: Network domain](https://chromedevtools.github.io/devtools-protocol/tot/Network/), read November 2, 2026
7. [curl: HTTP Cookies](https://curl.se/docs/http-cookies.html), read November 2, 2026
8. [Playwright: BrowserContext.addCookies](https://playwright.dev/docs/api/class-browsercontext), read November 2, 2026

## Questions

### Why did my imported cookies not sign me in?

Usually one of four things: the session had already expired or been logged out, the cookies were imported on a different site than the one they belong to, the site also keeps part of the login in local storage, or the site saw a new address and asked you to sign in again.

### Can I import a cookies.txt file into Chrome?

Not with Chrome alone. Cookie-Editor's Import reads the Netscape format, but each line must have exactly seven fields separated by tabs, so a file whose tabs were turned into spaces is rejected.

### Can an extension import HttpOnly cookies?

Yes. HttpOnly only hides a cookie from the page's own JavaScript. Extensions write cookies through Chrome's cookies API, which can set the HttpOnly flag.

### Do I need to restart Chrome after importing cookies?

No. Cookies set by an extension or through DevTools take effect at once. Reload the tab so the next request carries them.

## Related

[How to export cookies from Chrome](https://mosaicbrowser.com/guides/export-cookies-from-chrome): Chrome has no cookie export button. Use a cookie extension for one site, or yt-dlp for every site, and treat the file you get like a password.

[The Netscape cookie format, explained field by field](https://mosaicbrowser.com/guides/netscape-cookie-format-explained): A cookies.txt line holds domain, subdomain flag, path, secure flag, expiry, name and value, split by tabs. The HttpOnly prefix is not a comment.

[How to move a logged-in session to another browser](https://mosaicbrowser.com/guides/move-a-logged-in-session-to-another-browser): Browser import tools don't carry cookies. Export the site's cookies as JSON, import them into the other browser, and don't press Log out in the old one.

[How to use Playwright with an anti-detect browser](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser): Use Playwright with an anti-detect browser by starting the profile first and attaching with connectOverCDP. Keep its context; leave the fingerprint alone.

[Local first: your profiles stay on your computer](https://mosaicbrowser.com/features/local-first): Mosaic has no cloud copy of your profiles. Profiles, cookies and proxies stay on your computer, encrypted on disk, with app lock, daily backups and a trash.







[Mosaic gives every profile's cookies their own key](https://mosaicbrowser.com/blog/cookie-key-per-profile): Chrome on a Mac turns a Keychain password into an AES key with PBKDF2. Our engine lets Mosaic pass each profile its own password and keeps the v10 format.

## Run this guide on your own accounts

Every Mosaic profile is a fingerprint, a proxy IP and a cookie jar that agree with each other, kept on your computer. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
