AntiforgeryOptions.Cookie AntiforgeryOptions.Cookie AntiforgeryOptions.Cookie Property


Determines the settings used to create the antiforgery cookies.

public Microsoft.AspNetCore.Http.CookieBuilder Cookie { get; set; }
member this.Cookie : Microsoft.AspNetCore.Http.CookieBuilder with get, set
Public Property Cookie As CookieBuilder

Property Value


If an explicit Name is not provided, the system will automatically generate a unique name that begins with DefaultCookiePrefix.

SameSite defaults to Strict. HttpOnly defaults to true. IsEssential defaults to true. The cookie used by the antiforgery system is part of a security system that is necessary when using cookie-based authentication. It should be considered required for the application to function. SecurePolicy defaults to None.

Applies to