{
  "doc": {
    "id": "api/commands/getallcookies",
    "title": "getAllCookies | Cypress Documentation",
    "description": "Get all browser cookies in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/getallcookies.md",
    "version": "48b03b5502f7aea1d0454750cce208f775403542",
    "updated_at": "2026-05-20T19:00:20.270Z",
    "headings": [
      {
        "id": "api/commands/getallcookies#getallcookies",
        "text": "getAllCookies",
        "level": 1
      },
      {
        "id": "api/commands/getallcookies#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/getallcookies#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/getallcookies#get-cookies",
        "text": "Get Cookies",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#get-cookies-after-logging-in",
        "text": "Get cookies after logging in",
        "level": 4
      },
      {
        "id": "api/commands/getallcookies#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/getallcookies#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/getallcookies#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/getallcookies#syntax",
      "doc_id": "api/commands/getallcookies",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\ncy.getAllCookies()cy.getAllCookies(options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.getAllCookies() // Get all cookies\n```\n\n### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `cy.getAllCookies()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`responseTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `cy.getAllCookies()` to resolve before [timing out](#Timeouts) |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n`cy.getAllCookies()` yields an array of cookie objects. Each cookie object has the following properties:\n\n*   `domain`: _(String)_\n*   `expiry`: _(Number)_ _(if specified)_\n*   `hostOnly`: _(Boolean)_ _(if specified)_\n*   `httpOnly`: _(Boolean)_\n*   `name`: _(String)_\n*   `path`: _(String)_\n*   `sameSite`: _(String)_ _(if specified)_\n*   `secure`: _(Boolean)_\n*   `value`: _(String)_\n\n`cy.getAllCookies()` is not a query. It will not update the returned list if further cookies are added after it initially executes.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 199
    },
    {
      "id": "api/commands/getallcookies#arguments",
      "doc_id": "api/commands/getallcookies",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `cy.getAllCookies()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`responseTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `cy.getAllCookies()` to resolve before [timing out](#Timeouts) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 79
    },
    {
      "id": "api/commands/getallcookies#yields-learn-about-subject-management",
      "doc_id": "api/commands/getallcookies",
      "heading": "Yields Learn about subject management",
      "heading_level": 3,
      "content_markdown": "### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n`cy.getAllCookies()` yields an array of cookie objects. Each cookie object has the following properties:\n\n*   `domain`: _(String)_\n*   `expiry`: _(Number)_ _(if specified)_\n*   `hostOnly`: _(Boolean)_ _(if specified)_\n*   `httpOnly`: _(Boolean)_\n*   `name`: _(String)_\n*   `path`: _(String)_\n*   `sameSite`: _(String)_ _(if specified)_\n*   `secure`: _(Boolean)_\n*   `value`: _(String)_\n\n`cy.getAllCookies()` is not a query. It will not update the returned list if further cookies are added after it initially executes.\n",
      "section": "api",
      "anchors": [
        "yields-learn-about-subject-management"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 99
    },
    {
      "id": "api/commands/getallcookies#examples",
      "doc_id": "api/commands/getallcookies",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Get Cookies\n\n#### Get cookies after logging in\n\nIn this example, we log in through an identity provider which sets a cookie and redirects back to our site, which sets a session cookie.\n\n```\ncy.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')  })\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 76
    },
    {
      "id": "api/commands/getallcookies#get-cookies",
      "doc_id": "api/commands/getallcookies",
      "heading": "Get Cookies",
      "heading_level": 3,
      "content_markdown": "### Get Cookies\n\n#### Get cookies after logging in\n\nIn this example, we log in through an identity provider which sets a cookie and redirects back to our site, which sets a session cookie.\n\n```\ncy.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')  })\n```\n",
      "section": "api",
      "anchors": [
        "get-cookies"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 73
    },
    {
      "id": "api/commands/getallcookies#get-cookies-after-logging-in",
      "doc_id": "api/commands/getallcookies",
      "heading": "Get cookies after logging in",
      "heading_level": 4,
      "content_markdown": "#### Get cookies after logging in\n\nIn this example, we log in through an identity provider which sets a cookie and redirects back to our site, which sets a session cookie.\n\n```\ncy.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')  })\n```\n",
      "section": "api",
      "anchors": [
        "get-cookies-after-logging-in"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 69
    },
    {
      "id": "api/commands/getallcookies#rules",
      "doc_id": "api/commands/getallcookies",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `cy.getAllCookies()` requires being chained off of `cy`.\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `cy.getAllCookies()` will only run assertions you have chained once, and will not [retry](/llm/markdown/app/core-concepts/retry-ability.md).\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `cy.getAllCookies()` should never time out.\n\nBecause `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.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 101
    },
    {
      "id": "api/commands/getallcookies#timeouts-learn-about-timeouts",
      "doc_id": "api/commands/getallcookies",
      "heading": "Timeouts Learn about timeouts",
      "heading_level": 3,
      "content_markdown": "### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `cy.getAllCookies()` should never time out.\n\nBecause `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.\n",
      "section": "api",
      "anchors": [
        "timeouts-learn-about-timeouts"
      ],
      "path": "/llm/json/chunked/api/commands/getallcookies.json",
      "token_estimate": 55
    }
  ]
}