---
id: api/commands/getallcookies
title: getAllCookies | Cypress Documentation
description: Get all browser cookies in Cypress.
section: api
source_path: docs/api/commands/getallcookies.mdx
version: 3cf5b86b3403f604bdf7f3e35025c3bc3865e02c
updated_at: '2026-05-07T17:44:31.931Z'
---
# getAllCookies

Get all browser cookies.

## Syntax

```
cy.getAllCookies()cy.getAllCookies(options)
```

### Usage

**Correct Usage**

```
cy.getAllCookies() // Get all cookies
```

### Arguments

**options _(Object)_**

Pass in an options object to change the default behavior of `cy.getAllCookies()`.

| Option | Default | Description |
| --- | --- | --- |
| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |
| `timeout` | [`responseTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `cy.getAllCookies()` to resolve before [timing out](#Timeouts) |

### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)

`cy.getAllCookies()` yields an array of cookie objects. Each cookie object has the following properties:

*   `domain`: _(String)_
*   `expiry`: _(Number)_ _(if specified)_
*   `hostOnly`: _(Boolean)_ _(if specified)_
*   `httpOnly`: _(Boolean)_
*   `name`: _(String)_
*   `path`: _(String)_
*   `sameSite`: _(String)_ _(if specified)_
*   `secure`: _(Boolean)_
*   `value`: _(String)_

`cy.getAllCookies()` is not a query. It will not update the returned list if further cookies are added after it initially executes.

## Examples

### Get Cookies

#### Get cookies after logging in

In this example, we log in through an identity provider which sets a cookie and redirects back to our site, which sets a session cookie.

```
cy.contains('Log in').click()cy.origin('https://example.cypress.io', () => {  cy.get('[type=password]').type('*****')  cy.contains('Log in').click()})cy.url().should('include', 'profile')cy.getAllCookies()  .should('have.length', 2)  .then((cookies) => {    expect(cookies[0]).to.have.property('name', 'identity_session_id')    expect(cookies[1]).to.have.property('name', 'session_id')  })
```

## Rules

### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)

*   `cy.getAllCookies()` requires being chained off of `cy`.

### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)

*   `cy.getAllCookies()` will only run assertions you have chained once, and will not [retry](/llm/markdown/app/core-concepts/retry-ability.md).

### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)

*   `cy.getAllCookies()` should never time out.

Because `cy.getAllCookies()` is asynchronous it is technically possible for there to be a timeout while talking to the internal Cypress automation APIs. But for practical purposes it should never happen.

## See also

*   [`cy.clearAllCookies()`](/llm/markdown/api/commands/clearallcookies.md)
*   [`cy.clearCookie()`](/llm/markdown/api/commands/clearcookie.md)
*   [`cy.clearCookies()`](/llm/markdown/api/commands/clearcookies.md)
*   [`cy.getCookie()`](/llm/markdown/api/commands/getcookie.md)
*   [`cy.setCookie()`](/llm/markdown/api/commands/setcookie.md)
*   [`Cypress.Cookies.debug()`](/llm/markdown/api/cypress-api/cookies.md)
