Skip to content

Add support for Partitioned Cookies #53224

Open
@blowdart

Description

@blowdart

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

CookieBuilder should support the new Partitioned property from the CHIPS (Cookies Having Independent Partitioned State) spec. to avoid users having to fall back to the extensions property.

Both Chrome and Safari have indicated their support.

Describe the solution you'd like

A true or false property on CookieBuilder much like SameSite has today.

If the Paritioned property is set to true the cookie should be emitted with Partitioned;

Set-Cookie: Beans=baked; SameSite=None; Secure; HttpOnly; Path=/; Partitioned;

The Partioned attribute can only be used with a Secure attribute, and the spec says browsers MUST reject a partitioned cookie if Secure is not present, so the builder could throw an exception on build.

A cookie that does not have SameSite=None but is partitioned really isn't partitioned at all, it's not going to be seen by third parties, but in that case the spec says Browsers MAY, so a debug message may be useful in that circumstance to help users track down that mistake.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions