Skip to content

Conversation

@one-kash
Copy link

Summary

Add support for parsing and exposing the Partitioned cookie attribute, which is part of the CHIPS (Cookies Having Independent Partitioned State) proposal for improved privacy in cross-site contexts.

When set, partitioned cookies are only sent in requests where the top-level site matches the site that set the cookie, providing additional privacy protections for cross-site contexts.

Changes

  • Add partitioned boolean property to Cookie class with KDoc
  • Add parsing for Partitioned attribute in Set-Cookie header (case-insensitive)
  • Add partitioned() builder method
  • Include partitioned in equals(), hashCode(), and toString()
  • Add tests for parsing, builder, and serialization

Browser Support

This attribute is already supported by:

  • Chrome/Edge (since 2023)
  • Firefox (since v131)
  • Safari 18.4+

Test Plan

  • Added partitioned() test for parsing
  • Added partitionedToString() test for serialization
  • Added builderPartitioned() test for builder
  • Updated builder() test to verify default is false
  • Updated equalsAndHashCode() test with partitioned variations
  • All existing CookieTest tests pass

Fixes #8705

Add support for parsing and exposing the `Partitioned` cookie attribute,
which is part of the CHIPS (Cookies Having Independent Partitioned State)
proposal for improved privacy in cross-site contexts.

Changes:
- Add `partitioned` boolean property to Cookie class
- Add parsing for `Partitioned` attribute in Set-Cookie header
- Add `partitioned()` builder method
- Include in equals/hashCode/toString
- Add tests for parsing, builder, and serialization

Fixes square#8705
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.

Partioned attribute missing in Cookie

1 participant