# cookieStorage | @account-kit/core

> Overview of the cookieStorage 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 cookieStorage(config?): Storage;
```

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

Function to create cookie based Storage

## Parameters

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

  <tbody>
    <tr>
      <td>
        `config?`
      </td>

      <td>
        \{ `domain?`: `string`; `sessionLength?`: `number`; }
      </td>

      <td>
        optional config object
      </td>
    </tr>

    <tr>
      <td>
        `config.domain?`
      </td>

      <td>
        `string`
      </td>

      <td>
        optional domain to set the cookie on, eg: `example.com` if you want the cookie to work on all subdomains of example.com
      </td>
    </tr>

    <tr>
      <td>
        `config.sessionLength?`
      </td>

      <td>
        `number`
      </td>

      <td>
        **Deprecated**

        this option is deprecated and will be ignored
      </td>
    </tr>

  </tbody>
</table>

## Returns

`Storage`

an instance of a browser storage object that leverages cookies