For the complete documentation index, see llms.txt. This page is also available as Markdown.

Session Management

A Session represents a continuous period of app usage by a user, and it starts and expires based on specific conditions.

Session Start Conditions

A session starts under the following conditions by default.

  • When the identifier changes

  • When an event occurs after the session timeout period has elapsed

Session Expiration Conditions

When a new session starts, the previous session expires.

  • The session expiration time equals the time of the last event.

Session Policy

The Session Policy is a feature that allows fine-grained control over session persistence and expiration conditions. A Session Policy consists of two types of conditions.

Persist Condition

Determines whether to maintain the existing session or start a new one when the identifier changes.

Option
Default
Description

alwaysNewSession

default

Always starts a new session when the identifier changes.

nullToUserId

Keeps the existing session when userId changes from null to a specific value (i.e., on login). Starts a new session for any other identifier change.

Timeout Condition

Configures the conditions under which a session expires.

Setting
Default
Description

timeout

1800 seconds (30 min)

The session timeout duration.

onForeground

false

Whether to check the timeout when an event occurs in the foreground.

onBackground

true

Whether to check the timeout when an event occurs in the background.

onApplicationStateChange

true

Checks the timeout when the app state changes (foreground <-> background).

For specific configuration code for the Session Policy, refer to the SDK integration documentation for each SDK.

Last updated