Skip to main content
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.
Always reset on logout. Without it, the next person on the same device could inherit the previous user’s identity and study history.

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

Web

Sessions in the browser.

iOS

Sessions on iOS.

Android

Sessions on Android.