Table of Contents

Interface ICookieJar

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Defines an interface allowing the user to manipulate cookies on the current page.

public interface ICookieJar

Properties

AllCookies

Gets all cookies defined for the current page.

ReadOnlyCollection<Cookie> AllCookies { get; }

Property Value

ReadOnlyCollection<Cookie>

Methods

Adds a cookie to the current page.

void AddCookie(Cookie cookie)

Parameters

cookie Cookie

The Cookie object to be added.

Exceptions

ArgumentNullException

If cookie is null.

DeleteAllCookies()

Deletes all cookies from the page.

void DeleteAllCookies()

Deletes the specified cookie from the page.

void DeleteCookie(Cookie cookie)

Parameters

cookie Cookie

The Cookie to be deleted.

Exceptions

ArgumentNullException

If cookie is null.

DeleteCookieNamed(string)

Deletes the cookie with the specified name from the page.

void DeleteCookieNamed(string name)

Parameters

name string

The name of the cookie to be deleted.

Exceptions

ArgumentException

If name is null or Empty.

GetCookieNamed(string)

Gets a cookie with the specified name.

Cookie? GetCookieNamed(string name)

Parameters

name string

The name of the cookie to retrieve.

Returns

Cookie

The Cookie containing the name. Returns null if no cookie with the specified name is found.

Exceptions

ArgumentException

If name is null or Empty.