• Back to io.Connect Desktop docs
io.Connect Desktop Documentation

API Reference Documentation

  • Back to io.Connect Desktop docs
Press/
  • io.Connect Desktop
  • App Management
  • App Preferences
  • Channels
  • Cookies
  • Displays
  • Hotkeys
  • Intents
  • Interception
  • Interop
  • Layouts
  • Logger
  • Metrics
  • Notifications
  • Pub Sub
  • Search
  • Shared Contexts
  • Themes
  • Windows
  • Workspaces

Cookies

6.13.0

The Cookies API enables your web app to manage cookies. You can get a list of cookies by applying a filter that will be matched against all cookies, and also set and modify cookies, or remove cookies by name and URL.

The Cookies API is accessible through the io.cookies object.

APIobject

Description

Cookies API.

Methods

  • get
  • remove
  • set

getmethod

Signature

(filter?: CookiesGetFilter) => Promise<Cookie[]>

Description

Retrieves a list of cookies matching an optional filter object. If no filter is specified, will return all cookies.

Parameters

Name Type Required Description
filter CookiesGetFilter

Filter object that will be matched against all cookies. Only the cookies whose properties match the properties specified in the filter object will be returned.

removemethod

Signature

(url: string, name: string) => Promise<void>

Description

Removes a cookie with the specified URL and name.

Parameters

Name Type Required Description
url string

URL of the cookie to remove.

name string

Name of the cookie to remove.

setmethod

Signature

(cookie: CookiesSetDetails) => Promise<void>

Description

Sets a cookie or modifies an existing one with the specified values.

Parameters

Name Type Required Description
cookie CookiesSetDetails

Specifies which properties of the cookie to set.

Cookieobject

Description

Describes a cookie.

Properties

Property Type Default Required Description
domain string

Domain for the cookie. Normalized with a preceding dot in order to be valid for subdomains too.

expirationDate number

Expiration date of the cookie as a number of seconds since the UNIX epoch. Not available for session cookies.

hostOnly boolean

If true, the cookie has been flagged as a host-only cookie. Will be true only if the domain property hasn't been set.

httpOnly boolean

If true, the cookie has been marked with the HttpOnly attribute.

name string

Name of the cookie.

path string

Path for the cookie.

sameSite "unspecified" | "no_restriction" | "lax" | "strict"

The value applied to the SameSite attribute. Can be "unspecified", "no_restriction", "lax" or "strict".

secure boolean

If true, the cookie has been marked with a Secure attribute.

session boolean

If true, the cookie is a session cookie. If false, the cookie is a persistent cookie with an expiration date.

value string

Value of the cookie.

CookiesGetFilterobject

Description

Filter object whose properties will be matched against all cookies to be retrieved.

Properties

Property Type Default Required Description
domain string

Retrieves the cookies whose domains match or are subdomains of the specified domain.

name string

Filters the cookies by name.

path string

Retrieves the cookies whose paths match the specified path.

secure boolean

Filters cookies by their Secure attribute.

session boolean

If true, will return only the session cookies. If false, will return only the persistent cookies.

url string

Retrieves the cookies which are associated with the specified URL. If not specified, will retrieve the cookies for all URLs.

CookiesSetDetailsobject

Description

Describes the cookie to set.

Properties

Property Type Default Required Description
domain string

Domain for the cookie. Will be normalized with a preceding dot in order to be valid for subdomains too.

expirationDate number

The expiration date of the cookie as a number of seconds since the UNIX epoch. If not specified, the cookie will become a session cookie and won't be persisted between sessions.

httpOnly boolean false

If true, the cookie will be marked with an HttpOnly attribute.

name string

Name for the cookie.

path string

Path for the cookie.

sameSite "unspecified" | "no_restriction" | "lax" | "strict" "lax"

The value to be applied to the SameSite attribute. If set to "no_restriction", the secure property will be automatically set to true.

secure boolean false

If true, the cookie will be marked with a Secure attribute. Default is false, unless the SameSite attribute has been set to None.

url string

URL to associate with the cookie.

value string

Value for the cookie.

  • Home
  • Privacy policy
  • Contact Us
  • interop.io
  • Overview
  • API
  • Cookie
  • CookiesGetFilter
  • CookiesSetDetails
Navigate
Go