Skip to content

Comments

Add support for 'Default' SameSite cookie property (#14637)#3151

Merged
kblok merged 1 commit intomasterfrom
implement-upstream-change-14637
Feb 18, 2026
Merged

Add support for 'Default' SameSite cookie property (#14637)#3151
kblok merged 1 commit intomasterfrom
implement-upstream-change-14637

Conversation

@kblok
Copy link
Member

@kblok kblok commented Feb 18, 2026

Summary

  • Adds Default to the SameSite enum to represent cookies with browser-default SameSite behavior
  • Updates BiDi cookie conversion to map unknown/default values to SameSite.Default instead of SameSite.None
  • Updates CDP cookie setting to convert SameSite.Default to null (omitted), letting the browser apply its default behavior
  • Adds tests for setting, reading, and deleting cookies with SameSite.Default

Upstream PR: puppeteer/puppeteer#14637
Closes #3151

Test plan

  • Cookie tests pass with Chrome CDP (30 passed, 1 skipped)
  • Cookie tests pass with Firefox BiDi (28 passed, 3 skipped)
  • New test: ShouldProperlyReportDefaultSameSiteCookie
  • New test: ShouldReportDefaultSameSiteCookieWhenNotSpecified
  • New test: ShouldBeAbleToDeleteDefaultSameSiteCookie

🤖 Generated with Claude Code

Previously, unknown or unspecified SameSite values were mapped to 'None',
which caused issues when browsers (especially Firefox via BiDi) returned
cookies with default SameSite behavior. Setting SameSite=None requires
Secure=true, so re-setting or deleting such cookies would fail.

This adds 'Default' as a new SameSite enum value and handles it correctly:
- BiDi: maps to/from CookieSameSiteValue.Default
- CDP: converts to null (omitted) so the browser applies its default behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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