> ## Documentation Index
> Fetch the complete documentation index at: https://paperlinkai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversations, resume and browser storage

> How the widget keeps a visitor's conversation across visits and what it stores in the browser.

The widget keeps a visitor's conversation across page loads and return visits. It does this with two tokens that it stores in the visitor's browser.

## Tokens

| Token | Lifetime | Purpose |
| - | - | - |
| Session token | 1 hour | Authorizes messages in one conversation. |
| Resume token | 30 days from last use | Trades for a new session token without a Turnstile check. |

Each time the visitor resumes, the resume token gets a new 30-day lifetime.

## Where the widget stores them

The widget saves both tokens under the key `paperlink-widget-session:<hash>`. The hash depends on the API origin and the start of the API key, so two bots on one page keep separate sessions.

The widget uses the first storage that works:

1. `localStorage`
2. `sessionStorage`
3. Memory, which lasts until the visitor leaves the page

To clear the session in code, call `resetSession()` on the widget instance. The next message starts a new conversation.

## What the widget restores

When the visitor opens the widget, it loads the latest messages of the conversation. The `historyLimit` option sets how many. The default is 20, and the server accepts 1 to 100.

If the session token expired, the widget uses the resume token to get a new one. This step needs no Turnstile check.

## Conversation retention

Widget conversations stay while the workspace is active. Email [support@paperlinkai.com](mailto:support@paperlinkai.com) to delete them.

## Privacy and cookies

The widget sets no cookies. The Turnstile check is Cloudflare's own and follows Cloudflare's privacy terms. The browser storage holds opaque tokens only, and no message text. Use this information in your cookie policy.

> **[Error states and copy](https://paperlinkai.com/docs/developers/reference/error-states.md)**
>
> See what visitors read when something goes wrong.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.