Table of Contents

Class SetCookieHeader

Namespace
WebDriverBiDi.Network
Assembly
WebDriverBiDi.dll

Represents a header to set a cookie in a web response.

public class SetCookieHeader
Inheritance
SetCookieHeader
Inherited Members

Constructors

SetCookieHeader()

Initializes a new instance of the SetCookieHeader class.

public SetCookieHeader()

SetCookieHeader(string, string)

Initializes a new instance of the SetCookieHeader class.

public SetCookieHeader(string name, string value)

Parameters

name string

The name of the cookie.

value string

The string value of the cookie.

Initializes a new instance of the SetCookieHeader class.

public SetCookieHeader(Cookie cookie)

Parameters

cookie Cookie

The Cookie to convert to a header.

Properties

Domain

Gets or sets the domain of the cookie.

[JsonPropertyName("domain")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Domain { get; set; }

Property Value

string

Expires

Gets or sets the expiration time of the cookie.

[JsonIgnore]
public DateTime? Expires { get; set; }

Property Value

DateTime?

HttpOnly

Gets or sets 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")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? HttpOnly { get; set; }

Property Value

bool?

MaxAge

Gets or sets the max age of the cookie.

[JsonPropertyName("maxAge")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public long? MaxAge { get; set; }

Property Value

long?

Name

Gets or sets the name of the cookie.

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

Property Value

string

Path

Gets or sets the path of the cookie.

[JsonPropertyName("path")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Path { get; set; }

Property Value

string

SameSite

Gets or sets a value detailing whether the cookie is a same-site cookie.

[JsonPropertyName("sameSite")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public CookieSameSiteValue? SameSite { get; set; }

Property Value

CookieSameSiteValue?

Secure

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

[JsonPropertyName("secure")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Secure { get; set; }

Property Value

bool?

Value

Gets or sets the value of the cookie.

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

Property Value

BytesValue