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

# Session management

> Reset identity and manage in-progress study sessions in the browser SDK

The browser SDK stores audience identity, user properties, and in-progress study session references locally so users can resume where they left off. For the concepts behind this, see [About sessions](/sdk/concepts/sessions).

These session APIs are part of the `@trypillow/web` browser package.

## Reset on logout

Call `reset()` when the current user signs out.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
await sdk.reset();
```

`reset()` clears the external ID, removes stored properties, and rotates the SDK to a fresh anonymous audience session.

## Restart the active study

Call `clearSession()` when you want the currently presented study to start over.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
sdk.clearSession();
```

This clears the saved in-progress study session and reloads the hosted study fresh inside the widget shell.

## Control the widget

After `presentStudy(...)`, you can control the shell directly:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
sdk.close();
sdk.toggle();
```

Use these methods when you want to hide or restore the active hosted study without destroying the SDK instance. `presentStudy(...)` is the method that prepares and opens the study in the first place.

## What's next

<CardGroup cols={2}>
  <Card title="Identification" icon="badge-check" href="/sdk/web/identification">
    Understand how the SDK persists external IDs and user properties.
  </Card>

  <Card title="Studies" icon="message-square" href="/sdk/web/studies">
    Review presentation options and hosted study behavior.
  </Card>
</CardGroup>
