# parseCookie | @account-kit/core

> Overview of the parseCookie function from @account-kit/core

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function parseCookie(cookie, key): undefined | string;
```

Defined in: [account-kit/core/src/utils/cookies.ts:116](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/core/src/utils/cookies.ts#L116)

Helper function that can be used to parse a cookie string on the server or client

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `cookie`
      </td>

      <td>
        `string`
      </td>

      <td>
        the cookie string to parse
      </td>
    </tr>

    <tr>
      <td>
        `key`
      </td>

      <td>
        `string`
      </td>

      <td>
        the key of the cookie to parse
      </td>
    </tr>

  </tbody>
</table>

## Returns

`undefined` | `string`

the value of the cookie given a key if it exists, otherwise undefined