Table of Contents

Class SetCookieCommandSettings

Namespace
OpenQA.Selenium.DevTools.V148.Network
Assembly
Selenium.WebDriver.dll

Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

public sealed class SetCookieCommandSettings : ICommand
Inheritance
SetCookieCommandSettings
Implements
Inherited Members

Properties

CommandName

Gets the name of the command.

[JsonIgnore]
public string CommandName { get; }

Property Value

string

Domain

Cookie domain.

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

Property Value

string

Expires

Cookie expiration date, session cookie if not set

[JsonPropertyName("expires")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public double? Expires { get; set; }

Property Value

double?

HttpOnly

True if cookie is http-only.

[JsonPropertyName("httpOnly")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool? HttpOnly { get; set; }

Property Value

bool?

Name

Cookie name.

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

Property Value

string

PartitionKey

Cookie partition key. If not set, the cookie will be set as not partitioned.

[JsonPropertyName("partitionKey")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public CookiePartitionKey? PartitionKey { get; set; }

Property Value

CookiePartitionKey

Path

Cookie path.

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

Property Value

string

Priority

Cookie Priority type.

[JsonPropertyName("priority")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public CookiePriority? Priority { get; set; }

Property Value

CookiePriority?

SameSite

Cookie SameSite type.

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

Property Value

CookieSameSite?

Secure

True if cookie is secure.

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

Property Value

bool?

SourcePort

Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.

[JsonPropertyName("sourcePort")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public long? SourcePort { get; set; }

Property Value

long?

SourceScheme

Cookie source scheme type.

[JsonPropertyName("sourceScheme")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public CookieSourceScheme? SourceScheme { get; set; }

Property Value

CookieSourceScheme?

Url

The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.

[JsonPropertyName("url")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? Url { get; set; }

Property Value

string

Value

Cookie value.

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

Property Value

string