# API

**Kind**: interface | **Module**: [Cookies](https://docs.interop.io/desktop/reference/javascript/cookies/index.md) | **Access**: `io.cookies`

**Source**: https://docs.interop.io/desktop/reference/javascript/cookies/api/index.html

Cookies API.

## Methods

### get

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

```ts
(filter?: IOConnectDesktop.Cookies.CookiesGetFilter) => Promise<IOConnectDesktop.Cookies.Cookie[]>
```

**Parameters**

- **`filter`** (`IOConnectDesktop.Cookies.CookiesGetFilter`, optional)
  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.

**Returns**: `Promise<IOConnectDesktop.Cookies.Cookie[]>`

### remove

Removes a cookie with the specified URL and name.

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

**Parameters**

- **`url`** (`string`, required)
  URL of the cookie to remove.
- **`name`** (`string`, required)
  Name of the cookie to remove.

**Returns**: `Promise<void>`

### set

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

```ts
(cookie: IOConnectDesktop.Cookies.CookiesSetDetails) => Promise<void>
```

**Parameters**

- **`cookie`** (`IOConnectDesktop.Cookies.CookiesSetDetails`, required)
  Specifies which properties of the cookie to set.

**Returns**: `Promise<void>`

## Related types

- [Cookie](https://docs.interop.io/desktop/reference/javascript/cookies/cookie/index.md)
- [CookiesGetFilter](https://docs.interop.io/desktop/reference/javascript/cookies/cookiesgetfilter/index.md)
- [CookiesSetDetails](https://docs.interop.io/desktop/reference/javascript/cookies/cookiessetdetails/index.md)
