SetCookieHeaderValue.SameSite Property

Definition

Gets or sets a value for the SameSite cookie attribute.

"SameSite" cookies offer a robust defense against CSRF attack when deployed in strict mode, and when supported by the client.

C#
public Microsoft.Net.Http.Headers.SameSiteMode SameSite { get; set; }

Property Value

Remarks

See https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-05#section-8.8.

Applies to

Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0