Cookie

Provides functionality to manage browser cookies.

Classes

Cookie

Methods

(async) delete(name) → {Promise.<void>}

Deletes a specific cookie by name.
Parameters:
NameTypeDescription
namestringThe name of the cookie to delete.
Returns:
Type: 
Promise.<void>

(async) deleteAll() → {Promise.<void>}

Deletes all cookies for the current page.
Returns:
Type: 
Promise.<void>

(async) get(name) → {Promise.<(Object|undefined)>}

Gets a specific cookie by name.
Parameters:
NameTypeDescription
namestringThe name of the cookie.
Returns:
The cookie object, or undefined if not found.
Type: 
Promise.<(Object|undefined)>

(async) getAll() → {Promise.<Array>}

Gets all cookies for the current page.
Returns:
An array of cookie objects.
Type: 
Promise.<Array>

(async) set(name, value, optionsopt) → {Promise.<void>}

Sets a cookie.
Parameters:
NameTypeAttributesDescription
namestringThe name of the cookie.
valuestringThe value of the cookie.
optionsObject<optional>
Optional cookie properties.
Properties
NameTypeAttributesDescription
domainstring<optional>
The domain the cookie is visible to.
pathstring<optional>
The cookie path.
secureboolean<optional>
Whether the cookie is secure.
httpOnlyboolean<optional>
Whether the cookie is HTTP only.
expiryDate<optional>
When the cookie expires.
Returns:
Type: 
Promise.<void>