Table of Contents

Class Cookie

Namespace
WebDriverBiDi.Network
Assembly
WebDriverBiDi.dll

Represents a cookie in a web request or response.

public record Cookie : IEquatable<Cookie>
Inheritance
Cookie
Implements
Inherited Members

Constructors

protected Cookie(Cookie original)

Parameters

original Cookie

Properties

Gets the read-only dictionary containing extra data returned for this cookie.

[JsonIgnore]
public ReceivedDataDictionary AdditionalData { get; }

Property Value

ReceivedDataDictionary

Gets the domain of the cookie.

[JsonPropertyName("domain")]
[JsonRequired]
[JsonInclude]
public string Domain { get; }

Property Value

string

Gets the expiration time of the cookie as the total number of seconds elapsed since the start of the Unix epoch (1 January 1970 12:00AM UTC).

[JsonPropertyName("expiry")]
[JsonInclude]
public ulong? EpochExpires { get; }

Property Value

ulong?
protected virtual Type EqualityContract { get; }

Property Value

Type

Gets the expiration time of the cookie. An EpochExpires value too large to be represented by a DateTime is clamped to MaxValue. The value's Kind is always Utc, including when it is clamped.

[JsonIgnore]
public DateTime? Expires { get; }

Property Value

DateTime?

Gets a value indicating whether the cookie is only available via HTTP headers (true), or if the cookie can be inspected and manipulated via JavaScript (false).

[JsonPropertyName("httpOnly")]
[JsonRequired]
[JsonInclude]
public bool HttpOnly { get; }

Property Value

bool

Gets the name of the cookie.

[JsonPropertyName("name")]
[JsonRequired]
[JsonInclude]
public string Name { get; }

Property Value

string

Gets the path of the cookie.

[JsonPropertyName("path")]
[JsonRequired]
[JsonInclude]
public string Path { get; }

Property Value

string

Gets a value indicating whether the cookie is a same-site cookie.

[JsonPropertyName("sameSite")]
[JsonRequired]
[JsonInclude]
public CookieSameSiteValue SameSite { get; }

Property Value

CookieSameSiteValue

Gets a value indicating whether the cookie is secure, delivered via an encrypted connection like HTTPS.

[JsonPropertyName("secure")]
[JsonRequired]
[JsonInclude]
public bool Secure { get; }

Property Value

bool

Gets the byte length of the cookie when serialized in an HTTP cookie header.

[JsonPropertyName("size")]
[JsonRequired]
[JsonInclude]
public ulong Size { get; }

Property Value

ulong

Gets the value of the cookie.

[JsonPropertyName("value")]
[JsonRequired]
[JsonInclude]
public BytesValue Value { get; }

Property Value

BytesValue

Methods

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool
public virtual bool Equals(Cookie? other)

Parameters

other Cookie

Returns

bool
public override int GetHashCode()

Returns

int
protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Converts this cookie to a SetCookieHeader.

public SetCookieHeader ToSetCookieHeader()

Returns

SetCookieHeader

The SetCookieHeader representing this cookie.

public override string ToString()

Returns

string

Operators

public static bool operator ==(Cookie? left, Cookie? right)

Parameters

left Cookie
right Cookie

Returns

bool
public static bool operator !=(Cookie? left, Cookie? right)

Parameters

left Cookie
right Cookie

Returns

bool