DEV Community

Apoorv Darshan
Apoorv Darshan

Posted on

I built a local bridge for moving Chromium sessions on macOS

Browser Cookie Bridge running on macOS

Signing into the same services across several Chromium browsers gets repetitive quickly. Password managers can fill credentials, but they do not move an already authenticated session. Exporting browser data manually is awkward, and it is especially noticeable when a browser you use for automation does not offer an import path from your everyday browser.

I built Browser Cookie Bridge to solve that narrow problem on macOS: transfer cookies and signed-in sessions between Chromium browser profiles that you own and trust, without sending them through a cloud service.

The project supports Brave, Chrome, Edge, Arc, Vivaldi, Opera, and Perplexity Comet as sources or destinations. It can also import into ChatGPT Codex's built-in browser as a destination-only integration.

It is free, MIT-licensed, and available on GitHub and npm.

The two transfer paths

Browser Cookie Bridge deliberately uses different mechanisms for two different jobs.

Browser to browser

Chromium extensions have access to the browser's cookie and history APIs after the user explicitly grants the required permissions. Browser Cookie Bridge generates a small unpacked extension for each selected endpoint and connects those extensions through a short-lived local broker.

The flow looks like this:

  1. The native app starts a broker bound to 127.0.0.1.
  2. The source extension reads the selected cookies and, optionally, history URLs.
  3. The broker validates a random bearer token and the expected extension origin.
  4. The payload remains in broker memory until the destination extension requests it.
  5. The destination extension recreates the supported cookie attributes in the selected profile.

The broker limits payload size and normally exits after five minutes. Cookie values and history URLs are not written to logs, and there is no remote relay.

Generated extensions live under the user's Application Support directory and contain a random local token. Those folders should be treated as sensitive and never shared.

Browser to Codex

Codex is different because Browser Cookie Bridge cannot install or call a normal browser extension inside it. This path is therefore an intentionally unsupported direct integration, and Codex must be completely closed before a transfer begins.

The app reads the selected local Chromium profile, creates a consistent backup of Codex's SQLite browser storage, and performs the merge on a separate working copy. Before replacing anything, it:

  • verifies that the expected schema is present;
  • refuses unknown schemas instead of guessing;
  • runs SQLite integrity checks;
  • replaces the destination only after validation; and
  • restores the backup if replacement fails.

The newest 14 Codex backups are retained with user-only filesystem permissions.

This path does not pretend to be an official API. A future Codex update can change its storage layout, which is why failing safely matters more than trying to support every unknown schema.

What gets transferred

Cookies are enabled by default, including supported domain, path, expiry, security, SameSite, and partition attributes.

History URLs are optional, but their original visit timestamps and page titles cannot be preserved.

The tool never requests or transfers:

  • saved passwords;
  • bookmarks;
  • autofill or payment data; or
  • iCloud Keychain contents.

Some websites bind sessions to a browser, device, IP address, or other risk signals. Those sites may invalidate a transferred cookie and ask the user to sign in again.

The security limitation worth stating clearly

Cookies are credentials. Moving them is useful precisely because possession of the right cookie can represent an authenticated session.

OpenAI's Safe Storage key is protected by a private macOS Keychain access group. Browser Cookie Bridge cannot access that private key, so cookies imported directly into Codex use an empty encrypted_value. They may remain readable to software running as the same macOS user until the website refreshes them.

That means the correct trust boundary is the signed-in macOS account. Use the tool only with profiles you own and trust, protect your account, and never include real cookies, tokens, profiles, or databases in a bug report.

Native app and automation

The npm package builds a native SwiftUI menu-bar app locally on the Mac. It supports manual sync, sync at login, and an optional fixed daily schedule.

Scheduled Codex syncs exit without changing anything if Codex is open. The app never force-quits it.

The CLI remains available for users who prefer automation:

browser-cookie-bridge preferences \
  --source brave \
  --target codex \
  --cookies on \
  --history off

browser-cookie-bridge sync --timeout 300
browser-cookie-bridge doctor
Enter fullscreen mode Exit fullscreen mode

Install it

Browser Cookie Bridge requires macOS 13 or newer, Node.js 22.5 or newer, and the Xcode Command Line Tools.

npx browser-cookie-bridge install-app
Enter fullscreen mode Exit fullscreen mode

No administrator password is required. A first install goes to the user's Applications directory unless an existing writable system Applications copy is being updated.

You can inspect the implementation, security policy, tests, and setup instructions here:

If this solves a problem for you, a GitHub star or a carefully redacted bug report genuinely helps. Please never attach real browser data to a public issue.

Browser Cookie Bridge is not affiliated with Brave, Google, Microsoft, The Browser Company, Vivaldi, Opera, Perplexity, or OpenAI.

Top comments (0)