> For the complete documentation index, see [llms.txt](https://horizongames.gitbook.io/kronos-matchmaking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://horizongames.gitbook.io/kronos-matchmaking/usage/lobby/leaving-the-lobby.md).

# Leaving The Lobby

Leaving the lobby is exactly the **same as leaving a match**. Simply use the `LeaveKronosMatch` node and the player will disconnect from the game. The session will be cleaned up automatically. If called on the hosting player, all clients will be gracefully disconnected before closing the game.

There is no hard requirement on where you need to call this from. Most games will probably have this hooked to the `OnClicked` event of a widget button.

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

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

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

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

```cpp
UKronosOnlineSession* OnlineSession = UKronosOnlineSession::Get(this);
OnlineSession->LeaveGameSession();
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The `OnComplete` event is called when the leave has been requested so at that time the player is still in the match (disconnecting in the next frame).
{% endhint %}
