# Sessions

Settings for session capturing. Sessions for HLS, RTMP, SRT, HTTP, and FFmpeg are captured.

## Configurations

{% tabs %}
{% tab title="JSON" %}

```
{
   "sessions": {
      "enable": true,
      "ip_ignorelist": [
         "127.0.0.1/32",
         "::1/128"
      ],
      "session_timeout_sec": 30,
      "persist": false,
      "persist_interval_sec": 300,
      "max_bitrate_mbit": 0,
      "max_sessions": 0
   }
}
```

{% endtab %}

{% tab title="ENV" %}

```
CORE_SESSIONS_ENABLE=false
CORE_SESSIONS_IP_IGNORELIST="127.0.0.1/32,::1/128"
CORE_SESSIONS_SESSION_TIMEOUT_SEC=30
CORE_SESSIONS_PERSIST=false
CORE_SESSIONS_PERSIST_INTERVAL_SEC=300
CORE_SESSIONS_MAXBITRATE_MBIT=0
CORE_SESSIONS_MAXSESSIONS=0
```

{% endtab %}
{% endtabs %}

### enable (bool)

Set this value to true in order to enable session capturing.

By default this value is set to `true`.

### ip\_ignorelist (array)

List of IP ranges in CIDR notation to ignore for session capturing. If either end of a connection falls into this list of IPs, the session will not be captured. For the environment variable provide a comma-separated list of IP ranges in CIDR notation.

By default this value is set to `["127.0.0.1/32","::1/128"]`.

### session\_timeout\_sec (integer)

The timeout in seconds for an idle session. After this timeout the session is considered as closed. Applies only to HTTP and HLS sessions.

By default this value is set to `30` seconds.

### persist (bool)

Whether to persist the session history. The session history is stored as `sessions.json` in [db.dir](/core/configuration/database.md). If the session history is not persisted it will be kept only in memory.

By default the session history is not persisted, i.e. this value is set to `false`.

### persist\_interval\_sec (integer)

Interval in seconds in which to persist the current session history. This setting has only effect if persisting the session history is enabled.

By default this value is set to `300` seconds.

### max\_bitrate\_mbit (unsigned integer)

The maximum allowed outgoing bitrate in mbit/s. If the limit is reached, any new HLS sessions will be rejected. A value of 0 means no limitation of the outgoing bitrate.

By default this is value is set to `0`, i.e. unlimited.

### max\_sessions (unsigned integer)

The maximum allowed number of simultaneous sessions. If the limit is reached, any new HLS sessions will be rejected. A value of 0 means no limitation of the number of sessions.

By default this value is set to 0, i.e. unlimited.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datarhei.com/core/configuration/sessions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
