{
  "doc": {
    "id": "api/cypress-api/cookies",
    "title": "Cypress.Cookies | Cypress Documentation",
    "description": "Generate logs to the console whenever any cookies are modified in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/cookies.md",
    "version": "24a73f8a97175663aaffd3b016289fb2a523a4ea",
    "updated_at": "2026-05-14T20:17:33.301Z",
    "headings": [
      {
        "id": "api/cypress-api/cookies#cypress-cookies",
        "text": "Cypress.Cookies",
        "level": 1
      },
      {
        "id": "api/cypress-api/cookies#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/cookies#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/cypress-api/cookies#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/cookies#debug",
        "text": "Debug",
        "level": 3
      },
      {
        "id": "api/cypress-api/cookies#log-when-cookie-values-are-created-modified-or-deleted",
        "text": "Log when cookie values are created, modified or deleted",
        "level": 4
      },
      {
        "id": "api/cypress-api/cookies#turn-off-verbose-debugging-output",
        "text": "Turn off verbose debugging output",
        "level": 4
      },
      {
        "id": "api/cypress-api/cookies#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/cypress-api/cookies#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/cypress-api/cookies#syntax",
      "doc_id": "api/cypress-api/cookies",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\nCypress.Cookies.debug(enable, options)\n```\n\n### Arguments\n\n**enable _(Boolean)_**\n\nWhether cookie debugging should be enabled.\n\n**options _(Object)_**\n\nPass in an options object to control the behavior of `Cookies.debug()`.\n\n| option | description | default |\n| --- | --- | --- |\n| verbose | Whether or not to display the entire cookie object. | true |\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 77
    },
    {
      "id": "api/cypress-api/cookies#arguments",
      "doc_id": "api/cypress-api/cookies",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**enable _(Boolean)_**\n\nWhether cookie debugging should be enabled.\n\n**options _(Object)_**\n\nPass in an options object to control the behavior of `Cookies.debug()`.\n\n| option | description | default |\n| --- | --- | --- |\n| verbose | Whether or not to display the entire cookie object. | true |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 69
    },
    {
      "id": "api/cypress-api/cookies#examples",
      "doc_id": "api/cypress-api/cookies",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Debug\n\n#### Log when cookie values are created, modified or deleted\n\nBy turning on debugging, Cypress will automatically generate logs to the console when it _sets_ or _clears_ cookie values. This is useful to help you understand how Cypress clears cookies before each test, and is useful to visualize how to handle preserving cookies in between tests.\n\n```\nCypress.Cookies.debug(true) // now Cypress will log when it alters cookiescy.clearCookie('foo')cy.setCookie('foo', 'bar')\n```\n\n#### Turn off verbose debugging output\n\nBy default Cypress will log the cookie object which allows you to inspect all of its properties. However you may not need that level of detail and you can turn this off.\n\n```\nCypress.Cookies.debug(true, { verbose: false })\n```\n\nNow when Cypress logs cookies they will only include the `name` and `value`.\n\nDebugging will be turned on until you explicitly turn it off.\n\n```\nCypress.Cookies.debug(false) // now debugging is turned off\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 201
    },
    {
      "id": "api/cypress-api/cookies#debug",
      "doc_id": "api/cypress-api/cookies",
      "heading": "Debug",
      "heading_level": 3,
      "content_markdown": "### Debug\n\n#### Log when cookie values are created, modified or deleted\n\nBy turning on debugging, Cypress will automatically generate logs to the console when it _sets_ or _clears_ cookie values. This is useful to help you understand how Cypress clears cookies before each test, and is useful to visualize how to handle preserving cookies in between tests.\n\n```\nCypress.Cookies.debug(true) // now Cypress will log when it alters cookiescy.clearCookie('foo')cy.setCookie('foo', 'bar')\n```\n\n#### Turn off verbose debugging output\n\nBy default Cypress will log the cookie object which allows you to inspect all of its properties. However you may not need that level of detail and you can turn this off.\n\n```\nCypress.Cookies.debug(true, { verbose: false })\n```\n\nNow when Cypress logs cookies they will only include the `name` and `value`.\n\nDebugging will be turned on until you explicitly turn it off.\n\n```\nCypress.Cookies.debug(false) // now debugging is turned off\n```\n",
      "section": "api",
      "anchors": [
        "debug"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 199
    },
    {
      "id": "api/cypress-api/cookies#log-when-cookie-values-are-created-modified-or-deleted",
      "doc_id": "api/cypress-api/cookies",
      "heading": "Log when cookie values are created, modified or deleted",
      "heading_level": 4,
      "content_markdown": "#### Log when cookie values are created, modified or deleted\n\nBy turning on debugging, Cypress will automatically generate logs to the console when it _sets_ or _clears_ cookie values. This is useful to help you understand how Cypress clears cookies before each test, and is useful to visualize how to handle preserving cookies in between tests.\n\n```\nCypress.Cookies.debug(true) // now Cypress will log when it alters cookiescy.clearCookie('foo')cy.setCookie('foo', 'bar')\n```\n",
      "section": "api",
      "anchors": [
        "log-when-cookie-values-are-created-modified-or-deleted"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 92
    },
    {
      "id": "api/cypress-api/cookies#turn-off-verbose-debugging-output",
      "doc_id": "api/cypress-api/cookies",
      "heading": "Turn off verbose debugging output",
      "heading_level": 4,
      "content_markdown": "#### Turn off verbose debugging output\n\nBy default Cypress will log the cookie object which allows you to inspect all of its properties. However you may not need that level of detail and you can turn this off.\n\n```\nCypress.Cookies.debug(true, { verbose: false })\n```\n\nNow when Cypress logs cookies they will only include the `name` and `value`.\n\nDebugging will be turned on until you explicitly turn it off.\n\n```\nCypress.Cookies.debug(false) // now debugging is turned off\n```\n",
      "section": "api",
      "anchors": [
        "turn-off-verbose-debugging-output"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 104
    },
    {
      "id": "api/cypress-api/cookies#history",
      "doc_id": "api/cypress-api/cookies",
      "heading": "History",
      "heading_level": 2,
      "content_markdown": "## History\n\n| Version | Changes |\n| --- | --- |\n| [11.0.0](/llm/markdown/app/references/changelog.md#11-0-0) | Removed `preserveOnce` and `defaults` |\n| [9.7.0](/llm/markdown/app/references/changelog.md#9-7-0) | Deprecated `preserveOnce` and `defaults` |\n| [5.0.0](/llm/markdown/app/references/changelog.md#5-0-0) | Renamed `whitelist` option to `preserve` |\n| [0.16.1](/llm/markdown/app/references/changelog.md#0-16-1) | `{verbose: false}` option added |\n| [0.16.0](/llm/markdown/app/references/changelog.md#0-16-0) | Removed support for `Cypress.Cookies.get`, `Cypress.Cookies.set` and `Cypress.Cookies.remove` |\n| [0.12.4](/llm/markdown/app/references/changelog.md#0-12-4) | `Cypress.Cookies` API added |\n",
      "section": "api",
      "anchors": [
        "history"
      ],
      "path": "/llm/json/chunked/api/cypress-api/cookies.json",
      "token_estimate": 84
    }
  ]
}