fix(cookies): restore cookie bridge in server mode for cross-tab auth#608
Merged
fix(cookies): restore cookie bridge in server mode for cross-tab auth#608
Conversation
…e server mode Previously, server mode set skipCookieBridge globally via setGlobalConfig(), disabling cookie bridging for ALL page creations. This meant tab 2 would not inherit cookies from an authenticated tab 1 within the same session (issue #606). The skip was only needed for pool pre-warming (about:blank pages) to avoid CDP session conflicts. CDPConnectionPool.createNewPage() already passes skipCookieBridge=true per-call, so removing the global flag is safe. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #606 — Root Cause C:
skipCookieBridgewas set globally in server mode, breaking cross-tab cookie inheritance.--server-modecalledsetGlobalConfig({ skipCookieBridge: true }), which disabled cookie bridging for all page creations in the processabout:blankpages) to avoid CDP session conflicts — not for normal page creationRoot Cause C
CDPConnectionPool.createNewPage()already passesskipCookieBridge: trueexplicitly as the third argument tocreatePage():So the global flag in server mode was redundant for pool pre-warming and harmful for normal page creation. Removing it restores cookie bridging for user-initiated tab creation while pool pre-warming continues to skip it per-call.
Changes
src/index.ts: RemovedsetGlobalConfig({ skipCookieBridge: true })from server mode startupsrc/cdp/client.ts: Updated stale comment to reflect that the global flag is a manual override escape hatch, not set automatically by server modeTest plan
npm run buildnpm test -- --testPathPattern="cookie|connection-pool"about:blank)🤖 Generated with Claude Code