{
  "type": "module",
  "source": "doc/api/api-cookies.md",
  "modules": [
    {
      "textRaw": "Cookie Handling",
      "name": "cookie_handling",
      "type": "module",
      "modules": [
        {
          "textRaw": "`Cookie` interface",
          "name": "`cookie`_interface",
          "type": "module",
          "desc": "<ul>\n<li><strong>name</strong> <code>string</code></li>\n<li><strong>value</strong> <code>string</code></li>\n<li><strong>expires</strong> <code>Date|number</code> (optional)</li>\n<li><strong>maxAge</strong> <code>number</code> (optional)</li>\n<li><strong>domain</strong> <code>string</code> (optional)</li>\n<li><strong>path</strong> <code>string</code> (optional)</li>\n<li><strong>secure</strong> <code>boolean</code> (optional)</li>\n<li><strong>httpOnly</strong> <code>boolean</code> (optional)</li>\n<li><strong>sameSite</strong> <code>'Strict'|'Lax'|'None'</code> (optional)</li>\n<li><strong>unparsed</strong> <code>string[]</code> (optional) Left over attributes that weren't parsed.</li>\n</ul>",
          "displayName": "`Cookie` interface"
        }
      ],
      "methods": [
        {
          "textRaw": "`deleteCookie(headers, name[, attributes])`",
          "name": "deleteCookie",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "headers"
                },
                {
                  "name": "name"
                },
                {
                  "name": "attributes",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Sets the expiry time of the cookie to the unix epoch, causing browsers to delete it when received.</p>\n<pre><code class=\"language-js\">import { deleteCookie, Headers } from 'undici'\n\nconst headers = new Headers()\ndeleteCookie(headers, 'name')\n\nconsole.log(headers.get('set-cookie')) // name=; Expires=Thu, 01 Jan 1970 00:00:00 GMT\n</code></pre>\n<p>Arguments:</p>\n<ul>\n<li><strong>headers</strong> <code>Headers</code></li>\n<li><strong>name</strong> <code>string</code></li>\n<li><strong>attributes</strong> <code>{ path?: string, domain?: string }</code> (optional)</li>\n</ul>\n<p>Returns: <code>void</code></p>"
        },
        {
          "textRaw": "`getCookies(headers)`",
          "name": "getCookies",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "headers"
                }
              ]
            }
          ],
          "desc": "<p>Parses the <code>Cookie</code> header and returns a list of attributes and values.</p>\n<pre><code class=\"language-js\">import { getCookies, Headers } from 'undici'\n\nconst headers = new Headers({\n  cookie: 'get=cookies; and=attributes'\n})\n\nconsole.log(getCookies(headers)) // { get: 'cookies', and: 'attributes' }\n</code></pre>\n<p>Arguments:</p>\n<ul>\n<li><strong>headers</strong> <code>Headers</code></li>\n</ul>\n<p>Returns: <code>Record&#x3C;string, string></code></p>"
        },
        {
          "textRaw": "`getSetCookies(headers)`",
          "name": "getSetCookies",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "headers"
                }
              ]
            }
          ],
          "desc": "<p>Parses all <code>Set-Cookie</code> headers.</p>\n<pre><code class=\"language-js\">import { getSetCookies, Headers } from 'undici'\n\nconst headers = new Headers({ 'set-cookie': 'undici=getSetCookies; Secure' })\n\nconsole.log(getSetCookies(headers))\n// [\n//   {\n//     name: 'undici',\n//     value: 'getSetCookies',\n//     secure: true\n//   }\n// ]\n\n</code></pre>\n<p>Arguments:</p>\n<ul>\n<li><strong>headers</strong> <code>Headers</code></li>\n</ul>\n<p>Returns: <code>Cookie[]</code></p>"
        },
        {
          "textRaw": "`parseCookie(cookie)`",
          "name": "parseCookie",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "cookie"
                }
              ]
            }
          ],
          "desc": "<p>Parses a single <code>Set-Cookie</code> header value into a <code>Cookie</code> object.</p>\n<pre><code class=\"language-js\">import { parseCookie } from 'undici'\n\nconsole.log(parseCookie('undici=getSetCookies; Secure; SameSite=Lax'))\n// {\n//   name: 'undici',\n//   value: 'getSetCookies',\n//   secure: true,\n//   sameSite: 'Lax'\n// }\n</code></pre>\n<p>Notes:</p>\n<ul>\n<li>The cookie value is returned as it appears in the header. Percent-encoded sequences such as <code>%20</code> or <code>%0D%0A</code> are <strong>not</strong> decoded.</li>\n<li><code>sameSite</code> is only set for exact case-insensitive matches of <code>Strict</code>, <code>Lax</code>, or <code>None</code>.</li>\n</ul>\n<p>Arguments:</p>\n<ul>\n<li><strong>cookie</strong> <code>string</code></li>\n</ul>\n<p>Returns: <code>Cookie | null</code></p>"
        },
        {
          "textRaw": "`setCookie(headers, cookie)`",
          "name": "setCookie",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "headers"
                },
                {
                  "name": "cookie"
                }
              ]
            }
          ],
          "desc": "<p>Appends a cookie to the <code>Set-Cookie</code> header.</p>\n<pre><code class=\"language-js\">import { setCookie, Headers } from 'undici'\n\nconst headers = new Headers()\nsetCookie(headers, { name: 'undici', value: 'setCookie' })\n\nconsole.log(headers.get('Set-Cookie')) // undici=setCookie\n</code></pre>\n<p>Arguments:</p>\n<ul>\n<li><strong>headers</strong> <code>Headers</code></li>\n<li><strong>cookie</strong> <code>Cookie</code></li>\n</ul>\n<p>Returns: <code>void</code></p>"
        }
      ],
      "displayName": "Cookie Handling"
    }
  ]
}