Skip to content

Add parameters to set samesite for any arbitrary cookie #10342

@GuySartorelli

Description

@GuySartorelli

#10335 introduces configuration to set a default samesite value for cookies, but because of BC concerns we couldn't add parameters to set a specific samesite value for any (separate) given cookie.

Acceptance criteria

  • $sameSite param = '' is added as added to the following:
    • CookieJar::outputCookie()
    • Cookie::set(), Cookie_Backend::set() and CookieJar::set()
    • Cookie::forceExpiry(), Cookie_Backend::forceExpiry() and CookieJar::forceExpiry()?
    • Anywhere else it's needed
  • When the default blank string param is used, fallback to the Cookie.default_samesite configuration variable
  • Session::start() should pass its samesite value into this parameter instead of CookieJar checking the Session.cookie_samesite config.

PRs

Kitchen sink CI run
Note this doesn't include any fixes from silverstripe/.github#376 so some builds may be red
Compare with https://github.com/silverstripe/recipe-kitchen-sink/actions/runs/13821934870

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions