StoredCookie Class

A cookie of a CookieJar (https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-storage-model).

public sealed class StoredCookie

Constructors

NameDescription
StoredCookie()Creates a cookie (e.g. a cookie loaded by a CookiePersistence).

StoredCookie()

CookieJar.cs
  • Obsolete: Constructors of types with required members are not supported in this version of your compiler.

Creates a cookie (e.g. a cookie loaded by a CookiePersistence).

[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
public StoredCookie()

Properties

NameDescription
CreationTimeGets the creation time of the cookie (the time of the cookie it replaced, if any).
DomainGets the domain of the cookie: the host of the URL that set it, or the domain of its Domain attribute (see StoredCookie.HostOnly).
ExpiresGets the expiry time of the cookie, or null for a session cookie (without Expires or Max-Age attribute).
HostOnlyGets whether the cookie is only sent to the host of StoredCookie.Domain (it has no Domain attribute).
HttpOnlyGets whether the cookie is hidden from the scripts (the HttpOnly attribute).
LastAccessTimeGets the last time the cookie was sent (or created), which orders the eviction of the excess cookies. The jar updates the persisted access time at most once a minute. The default value is the creation time.
NameGets the name of the cookie (an isomorphic string: each character is a byte).
PartitionKeyGets the partition key of a partitioned cookie (a cookie with the Partitioned attribute), or null.
PathGets the path of the cookie.
SameSiteGets the same-site flag of the cookie, or null when it has no valid SameSite attribute (the cookie is then CookieSameSite.Lax by default).
SecureGets whether the cookie is only sent over secure connections (the Secure attribute).
ValueGets the value of the cookie (an isomorphic string: each character is a byte).

CreationTime

CookieJar.cs

Gets the creation time of the cookie (the time of the cookie it replaced, if any).

public DateTimeOffset CreationTime { get; init; }

Property value

DateTimeOffset

Gets the domain of the cookie: the host of the URL that set it, or the domain of its Domain attribute (see StoredCookie.HostOnly).

public required string Domain { get; init; }

Property value

string

Gets the expiry time of the cookie, or null for a session cookie (without Expires or Max-Age attribute).

public DateTimeOffset? Expires { get; init; }

Property value

DateTimeOffset?

HostOnly

CookieJar.cs

Gets whether the cookie is only sent to the host of StoredCookie.Domain (it has no Domain attribute).

public bool HostOnly { get; init; }

Property value

bool

HttpOnly

CookieJar.cs

Gets whether the cookie is hidden from the scripts (the HttpOnly attribute).

public bool HttpOnly { get; init; }

Property value

bool

LastAccessTime

CookieJar.cs

Gets the last time the cookie was sent (or created), which orders the eviction of the excess cookies. The jar updates the persisted access time at most once a minute. The default value is the creation time.

public DateTimeOffset LastAccessTime { get; init; }

Property value

DateTimeOffset

Gets the name of the cookie (an isomorphic string: each character is a byte).

public required string Name { get; init; }

Property value

string

PartitionKey

CookieJar.cs

Gets the partition key of a partitioned cookie (a cookie with the Partitioned attribute), or null.

public CookiePartitionKey? PartitionKey { get; init; }

Property value

CookiePartitionKey?

Gets the path of the cookie.

public required string Path { get; init; }

Property value

string

SameSite

CookieJar.cs

Gets the same-site flag of the cookie, or null when it has no valid SameSite attribute (the cookie is then CookieSameSite.Lax by default).

public CookieSameSite? SameSite { get; init; }

Property value

CookieSameSite?

Gets whether the cookie is only sent over secure connections (the Secure attribute).

public bool Secure { get; init; }

Property value

bool

Gets the value of the cookie (an isomorphic string: each character is a byte).

public required string Value { get; init; }

Property value

string