# Updating Lobby Session

In most cases you will want to update the **Session Settings** of the lobby at some point because of changes in the game (such as playing on a new map).

## Updating Session Settings

To update the **Session Settings** of a session you first have to get a copy of its current settings, make the changes on the copy, and then push the changes back to the session through the **Online Subsystem**. The `KronosOnlineSession` class contains all the necessary functionality to update sessions.

{% hint style="info" %}
The lobby is considered a **Game Session** since it is used as part of an online match.
{% endhint %}

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

<figure><img src="/files/usNoiSD7tH5E616CWR0S" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="C++" %}

```cpp
#include "KronosOnlineSession.h"
```

```cpp
// Get the online session. Note that the OnlineSession class is the manager
// and not the actual session we are updating!
UKronosOnlineSession* OnlineSession = UKronosOnlineSession::Get(this);
if (OnlineSession)
{
    // Get the current session settings for the match that we are in.
    FKronosSessionSettings UpdatedSettings;
    if (OnlineSession->GetSessionSettings(NAME_GameSession, UpdatedSettings))
    {
        // Change the playlist of the match.
        UpdatedSettings.Playlist = TEXT("NewPlaylist");

        // Whether we want to push the changes to the backend (e.g. Steam) or not.
        // If this is false, only the local player's view of the session will be updated.
        bool bRefreshOnlineData = true;

        // Update the session. This operation is async and may not finish immediately!
        OnlineSession->UpdateSession(NAME_GameSession, UpdatedSettings, bRefreshOnlineData);
    }
}
```

{% endtab %}
{% endtabs %}

## Important Note About Null Online Subsystem

The **Null Online Subsystem** doesn't support updating data online, so only the local player will see the changes. For other limitations of the Null OSS please refer to [**Using the Null Subsystem**](/kronos-matchmaking/testing-and-debugging.md#using-the-null-subsystem) section of the documentation.


---

# 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://horizongames.gitbook.io/kronos-matchmaking/usage/lobby/updating-lobby-session.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.
