Skip to content

fix: keep companion sessions by not mocking the macOS keychain#46

Merged
Anton-Horn merged 1 commit into
mainfrom
fix/companion-keychain-cookies
Jun 4, 2026
Merged

fix: keep companion sessions by not mocking the macOS keychain#46
Anton-Horn merged 1 commit into
mainfrom
fix/companion-keychain-cookies

Conversation

@Anton-Horn
Copy link
Copy Markdown
Contributor

Problem

The profile copy carried cookies over, but sites came up logged-out.

Playwright launches Chrome with --use-mock-keychain by default. On macOS that hands Chrome a mock encryption key, but the profile's cookies were encrypted with the real Chrome Safe Storage keychain key — so Chrome can't decrypt them and every site looks signed-out. (Same reason --live would have looked logged-out too.)

Fix

Drop --use-mock-keychain from the persistent launch (both the default copy mode and --live) via ignoreDefaultArgs, so Chrome uses the real keychain and the user's sessions decrypt.

Testing

tsc + build clean. Needs a real on-machine check — run zero browser connect and confirm a site you're logged into (e.g. Gmail) shows signed-in. macOS may show a one-time keychain prompt for "Chrome Safe Storage" — Always Allow.

🤖 Generated with Claude Code

Copying the profile carried the cookies over but they came up logged-out:
Playwright launches Chrome with --use-mock-keychain by default, which on
macOS hands Chrome a mock encryption key. The profile's cookies were
encrypted with the real "Chrome Safe Storage" keychain key, so Chrome
can't decrypt them and every site looks signed-out.

Drop --use-mock-keychain from the persistent launch (copy and --live) so
Chrome uses the real keychain and the user's sessions actually carry over.
@Anton-Horn Anton-Horn merged commit 3149e5d into main Jun 4, 2026
2 checks passed
@Anton-Horn Anton-Horn deleted the fix/companion-keychain-cookies branch June 4, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant