---
title: "Session Handling | Speedscale Docs"
description: "Manage session handling with Speedscale to automatically track and identify sessions during API traffic capture and replay for efficient testing."
canonical: "https://docs.speedscale.com/guides/replay/sessions/"
---

[Documentation index](https://docs.speedscale.com/guides/llms.txt) | [Markdown](https://docs.speedscale.com/guides/replay/sessions/index.md) | [Canonical page](https://docs.speedscale.com/guides/replay/sessions/)

# Session Handling

Front end applications and APIs typically have back and forth conversations that can be grouped into sessions. Speedscale automatically tracks sessions for common patterns like OAuth2. If Speedscale detects a session it will assign a session ID to each RRPair involved in the conversation during capture for easy sorting/filtering. During replay, sessions are handled automatically.

<a id="session-detection"></a>

## Session detection

In many cases, sessions are automatically detected and given a unique identifier matching some aspect of the traffic. As an example, consider an OAuth2 login. Open the login RRPair from the snapshot's **Traffic** tab and its **Response** body shows an `access_token` like this:

![The Response Body tab of a POST /oauth2/v1/token RRPair, with an access\_token and a token\_type of Bearer](https://docs.speedscale.com/assets/images/access_token-b9cf7e86164b23d623cbf26823559cc7.png)

Now choose **More** > **Info** on that same RRPair. You can tell that Speedscale detected this token because it uses the token as the Session ID.

![The Info view of the same RRPair, where the Session ID row holds the access\_token value](https://docs.speedscale.com/assets/images/session_id-b56580a35809198ef114f47f7a9465dc.png)

When a snapshot is created data about the sessions will be aggregated into a summary. The list of detected tokens/sessions can be viewed from the snapshot's **⋮** menu with **View Tokens**:

![The Tokens panel, with Unrecognized, Email, UUID, JWT and Datetime token groups and the location of each token](https://docs.speedscale.com/assets/images/token_summary-af9444e5c07499a6ef1f9f951b1d17dd.png)

<a id="replay"></a>

## Replay

During replay, Speedscale will automatically replace session IDs with their new value as returned by the server. When the load generator "logs in" it will expect the server to produce a new `access_token` response. Speedscale will detect and re-use that token wherever it is used in subsequent calls.

<a id="rotate-a-population-under-load"></a>

## Rotate a population under load

A session load group selects a population of recorded actors and replays complete journeys. Population size is separate from concurrency and session starts per second. See [endpoint and session load plans](https://docs.speedscale.com/guides/replay/endpoint-session-load-plans/#rotate-complete-banking-journeys) for rotation, budgets and endpoint-specific goals within a journey.
