CookieOptions CookieOptions CookieOptions Class


Options used to create a new cookie.

public class CookieOptions
type CookieOptions = class
Public Class CookieOptions


CookieOptions() CookieOptions() CookieOptions()

Creates a default cookie with a path of '/'.


Domain Domain Domain

Gets or sets the domain to associate the cookie with.

Expires Expires Expires

Gets or sets the expiration date and time for the cookie.

HttpOnly HttpOnly HttpOnly

Gets or sets a value that indicates whether a cookie is accessible by client-side script.

IsEssential IsEssential IsEssential

Indicates if this cookie is essential for the application to function correctly. If true then consent policy checks may be bypassed. The default value is false.

MaxAge MaxAge MaxAge

Gets or sets the max-age for the cookie.

Path Path Path

Gets or sets the cookie path.

SameSite SameSite SameSite

Gets or sets the value for the SameSite attribute of the cookie. The default value is Lax

Secure Secure Secure

Gets or sets a value that indicates whether to transmit the cookie using Secure Sockets Layer (SSL)--that is, over HTTPS only.

Applies to