Skip to content

fix(cookies): follow RFC 6265 domain and path matching in cookies(urls) - #43148

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:fix-43078
Oct 6, 2026
Merged

Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:fix-43078

Conversation

@dgozman

Copy link
Copy Markdown
Collaborator

Summary

  • browserContext.cookies(urls) and apiRequestContext.cookies(urls) no longer return host-only cookies for subdomains, or Path=/api cookies for /apiv2.
  • pathMatches follows RFC 6265 §5.1.4, so Path=/foo/ does not match /foo.
  • Cookie matching lives in one place (filterCookies); the second filtering pass in fetch.ts is gone.

Fixes #43078

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › playwright.trace.spec.ts:436 › should retain traces for interrupted tests @windows-latest-node22

3 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:213 › should intercept service worker requests (main and within) `@realtime-time-library-chromium-linux`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`

52666 passed, 1270 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures here.

🟢 The failure is a pre-existing flake — this PR is clear

The only red test is a test-runner interruption flake with exact failures on unrelated PRs. This PR only changes cookie domain and path matching, so it does not exercise the failing trace-retention path.

Details

Pre-existing flake / infra

The three flaky entries in the report passed on retry and do not change the verdict.

Triaged by the Playwright bot - agent run

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

9035 passed, 1495 skipped


Merge workflow run.

@dgozman
Dmitry Gozman (dgozman) merged commit f553916 into microsoft:main Oct 6, 2026
44 of 45 checks passed
Pavel Feldman (pavelfeldman) added a commit to pavelfeldman/playwright-python that referenced this pull request Oct 15, 2026
Roll the driver to 1.65.0-alpha-1792021904000
(microsoft/playwright@d96199f58) and Node.js to 24.22.0. Generate the
API from microsoft/playwright main with microsoft/playwright#43407. The
docs there have the Python type names and handler types, so most of
python_rules.js is not needed.

- Remove the extraClasses, skipArgs, argNames, typeOverrides, positional,
  structRenames and structNamesByPlace tables.
- Struct names follow the docs: HttpHeader, WebStorageItem, ScreenSize,
  RecordVideoSize, Clip and Location. The fields are the same.
- not_to_have_accessible_description(name) is now (description).
- Locator.highlight() returns a Disposable, like in JS.
- dispatch_event(event_init=) accepts any value, like in Java and C#.
- Disposable has close() and no dispose(); use close() or a context
  manager.
- Tests follow two driver changes: cookies(urls) matches domains as in
  RFC 6265 (microsoft/playwright#43148), and fill() no longer rejects
  malformed date and time values (microsoft/playwright#43400).
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.

[Bug]: cookies(urls) returns host-only and path-prefix cookies that do not apply to the URL; Path=/foo/ cookie is sent to /foo

2 participants