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

# Sessions

> How OneSignal defines and counts app sessions, the session properties (First Session, Last Session, Session Count), and how sessions power segmentation, analytics, and billing.

A session represents a period of app or website usage tracked by the OneSignal SDK. Sessions power several parts of OneSignal: they drive time-based [segmentation](./segmentation), they appear as an engagement metric in analytics, and a mobile Subscription's most recent session determines whether it counts toward billing.

## How sessions are counted

A session begins each time a user opens your app or website from a fully closed state, or reopens it after being in the background for at least 30 seconds. Returning within 30 seconds continues the current session instead of starting a new one.

Session data aggregates across a user's devices. Activity on any of a user's Subscriptions updates their session data, so a user with both a mobile app and a website is treated as active when they use either one. Email and SMS Subscriptions reflect the session values from the user's most recently active push Subscription.

OneSignal also tracks **Usage Duration**, the total time a Subscription was active on your app or site. Usage Duration is only tracked when a session exceeds 60 seconds.

## Session properties

Each Subscription carries three session properties:

| Property          | Description                                                                                                                                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **First Session** | The date and time the first subscription associated with the user was created (API: `user.properties.first_active`).                                                                                                      |
| **Last Session**  | The most recent time the user's push subscription opened your app or website (API: `user.properties.last_active`). Email and SMS subscriptions inherit this value from the user's most recently active push subscription. |
| **Session Count** | The number of times the subscription has opened your app or visited your website (API: `subscription.session_count`). Email and SMS subscriptions inherit the count from the most active push subscription.               |

Session data aggregates across a user's subscriptions. Activity on any of a user's devices updates their last session, and email and SMS subscriptions reflect the values from the most recently active push subscription. See [Users and Subscriptions](/docs/en/subscriptions) for how these properties behave across a user's devices.

## Sessions in segmentation

You can build [Segments](./segmentation) using session properties without any custom code:

* **First session** and **Last session** filters target users by when they first became active or how long they have been inactive (for example, `Last Session > 7 days ago` for a re-engagement audience).
* **Session count** filters target users by how many times they have opened your app or site.

See [Segmentation](./segmentation) for the full list of filters and operators.

## Sessions in analytics

**App Sessions** is a default [conversion metric](./conversion-metrics): it counts every qualifying app open as a session, and sessions are attributed to a message when one qualifies. Sessions also appear on push message reports and in [Template Analytics](./template-analytics) as a per-message metric.

Sessions recorded before June 25, 2025 appear on the outcomes chart and follow the legacy outcomes attribution model rather than the conversion metrics attribution model. See [Conversion metrics](./conversion-metrics) for how sessions are attributed today.

## Sessions and in-app messages

In-app messages are evaluated at the start of a session. A user must match the message's audience *before* a new session starts for the message to display, which is why a user who joins the audience mid-session sees the message on their next app open rather than immediately. See [How in-app messages are shown](./in-app-messages-setup#how-in-app-messages-are-shown) for the full requirements.

## Sessions and billing

A mobile Subscription's last session determines whether it counts toward Monthly Active Users (MAU) for billing. See [Billing FAQ](./billing-faq) for how MAU is calculated.

## FAQ

### Why don't sessions match other analytics tools?

A session begins each time a user opens your app or website from a fully closed state, or reopens it after being in the background for at least 30 seconds. Returning within 30 seconds continues the current session instead of starting a new one.

Other analytics tools may define a session differently. For example, some might count any app open that lasts at least a couple of seconds as a separate session, which produces higher session counts than OneSignal.

### How are sessions counted across a user's devices?

Session data is tracked per Subscription and aggregated at the user level. Activity on any device updates the user's last session, and email and SMS Subscriptions inherit session values from the user's most recently active push Subscription. Assign [External IDs](./users) to unify a user's Subscriptions so their session data is combined.

## Related pages

<Columns cols={2}>
  <Card title="Users and Subscriptions" icon="user" href="./subscriptions">
    How Subscriptions store session properties and behave across a user's devices.
  </Card>

  <Card title="Segmentation" icon="filter" href="./segmentation">
    Build audiences using First session, Last session, and Session count filters.
  </Card>

  <Card title="Conversion metrics" icon="arrow-trend-up" href="./conversion-metrics">
    Track App Sessions and other conversions with cross-channel attribution.
  </Card>

  <Card title="In-app messages" icon="window" href="./in-app-messages-setup">
    Why in-app messages display on a new session.
  </Card>
</Columns>
