Skip to content

Add support for Partitioned Cookies #55370

@amcasey

Description

@amcasey

Background and Motivation

CHIPS is a draft for incrementally moving away from third-party cookies to improve privacy.

Feature request: #53224
PR: #55371

Proposed API

namespace Microsoft.Net.Http.Headers;

public class SetCookieHeaderValue
{
+    public bool Partitioned { get; set; }
}
namespace Microsoft.AspNetCore.Http;

public class CookieBuilder
{
+    public virtual bool Partitioned { get; set; }
}

public class CookieOptions
{
+    public bool Partitioned { get; set; }
}

Usage Examples

IResponseCookies responseCookies;
responseCookies.Append("cookieName", "cookieValue", new CookieOptions
{
    Partitioned = true,
    SameSite = SameSiteMode.None,
    Secure = true,
});

You can also use a CookieBuilder, but that won't do any validation (as for Same-Site).

Alternative Designs

n/a

Risks

I understand the CHIPS spec isn't actually finalized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedarea-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