> ## 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.

# About sessions

> How the SDK manages sessions, resets identity on logout, and queues work offline.

The SDK manages sessions for you. You don't start or stop them manually. A session begins anonymous, becomes tied to a user once you identify them, and resumes in-progress studies automatically. This page covers the moments where you do need to act: logout, restarting a study, and going offline.

## Reset on logout

Call `reset()` whenever a user signs out. Reset clears the external ID and all user properties and rotates the SDK to a fresh anonymous session.

<Warning>
  Always reset on logout. Without it, the next person on the same device could inherit the previous user's identity and study history.
</Warning>

## Restart a study

When you want a study the user has already started to begin again from scratch, clear its saved session. The SDK drops the in-progress reference and reloads the study fresh the next time you present it.

## Offline behavior

The SDK keeps working when the device is offline. Calls you make (identifying a user, setting properties, presenting a study) are queued locally and applied when connectivity returns:

* Operations are persisted to local storage, so they survive an app restart.
* The queue drains automatically once the connection is back.
* Operations older than **24 hours** are discarded.
* Duplicate operations are deduplicated.

This means you can call identification and presentation methods without first checking for a connection.

## Per-platform reference

<CardGroup cols={3}>
  <Card title="Web" icon="globe" href="/sdk/web/session-management">
    Sessions in the browser.
  </Card>

  <Card title="iOS" icon="smartphone" href="/sdk/ios/session-management">
    Sessions on iOS.
  </Card>

  <Card title="Android" icon="smartphone" href="/sdk/android/session-management">
    Sessions on Android.
  </Card>
</CardGroup>
