CookieBuilder CookieBuilder CookieBuilder CookieBuilder Class

Definition

Defines settings used to create a cookie.

public ref class CookieBuilder
public class CookieBuilder
type CookieBuilder = class
Public Class CookieBuilder
Inheritance
CookieBuilderCookieBuilderCookieBuilderCookieBuilder
Derived

Constructors

CookieBuilder() CookieBuilder() CookieBuilder() CookieBuilder()

Properties

Domain Domain Domain Domain

The domain to associate the cookie with.

Expiration Expiration Expiration Expiration

Gets or sets the lifespan of a cookie.

HttpOnly HttpOnly HttpOnly HttpOnly

Indicates whether a cookie is accessible by client-side script.

IsEssential 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 MaxAge

Gets or sets the max-age for the cookie.

Name Name Name Name

The name of the cookie.

Path Path Path Path

The cookie path.

SameSite SameSite SameSite SameSite

The SameSite attribute of the cookie. The default value is None

SecurePolicy SecurePolicy SecurePolicy SecurePolicy

The policy that will be used to determine . This is determined from the HttpContext passed to Build(HttpContext, DateTimeOffset).

Methods

Build(HttpContext) Build(HttpContext) Build(HttpContext) Build(HttpContext)

Creates the cookie options from the given context.

Build(HttpContext, DateTimeOffset) Build(HttpContext, DateTimeOffset) Build(HttpContext, DateTimeOffset) Build(HttpContext, DateTimeOffset)

Creates the cookie options from the given context with an expiration based on expiresFrom and Expiration.

Applies to