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

# Lobby lifetime and expiration

> Understand PlayFab Lobby TTL, default expiration, and how client-owned, server-owned, and connected lobbies affect lifetime and automatic deletion behavior.

This article explains how lobbies expire and are deleted. Lobby lifetime depends on the lobby type, connection state, and member activity. Understanding these behaviors helps you design your game to avoid unexpected lobby loss and keep search results clean.

## Overview

PlayFab Lobbies are temporary groupings of players. Every lobby has a time to live (TTL) that determines when it will be automatically deleted if left idle. The TTL is reset whenever there's activity on the lobby, such as a member joining, leaving, or updating lobby data.

The two most important factors that determine how long a lobby lives are:

* **Lobby type**: Whether the lobby is client-owned or server-owned.
* **Connection state**: Whether members (and servers) are connected through real-time notifications.

## Default lobby lifetime

When a lobby is created, it's assigned a default TTL of **1 hour**. Each time the lobby is updated—through member joins, data updates, or other operations—the TTL is refreshed back to its full duration.

For lobbies that use real-time notifications (connections), the TTL is extended to **4 hours** when a member connects. This longer TTL accounts for the fact that connected lobbies are actively monitored through the connection system and don't need to expire as quickly.

<Note>
  The lobby TTL resets on every lobby operation. A lobby that is actively being used will not expire due to TTL alone.
</Note>

## How connections affect lobby lifetime

Lobbies that use [real-time notifications](/services/playfab/multiplayer/lobby/lobby-and-matchmaking-real-time-messages) track member connections. The connection state of members directly impacts the lobby's lifetime and search visibility.

### Connected lobbies

When at least one member is connected to a client-owned lobby, the lobby remains searchable and has a maximum idle TTL of **4 hours**. As long as the lobby continues to receive updates or connection activity, the TTL continues to reset.

### Disconnected lobbies

When all members disconnect from a client-owned lobby, two things happen:

1. **The lobby is hidden from search.** This prevents other players from discovering a lobby that may be abandoned.
2. **The lobby TTL is reduced to 1 minute.** The lobby enters a brief grace period before deletion.

If a member reconnects during this grace period, the lobby is restored to full visibility and its TTL is extended back to 4 hours.

## Lifetime behavior by lobby type

Client-owned and server-owned lobbies have different expiration behaviors.

### Client-owned lobbies

| Scenario                                 | Behavior                                                                                |
| ---------------------------------------- | --------------------------------------------------------------------------------------- |
| Active with connected members            | TTL is 4 hours, reset on each operation. Lobby is searchable.                           |
| Active without connections               | TTL is 1 hour, reset on each operation. Lobby is searchable.                            |
| Owner disconnects                        | Owner migration is triggered per the **ownerMigrationPolicy**. No direct impact on TTL. |
| All members disconnect                   | Lobby is hidden from search. TTL is reduced to 1 minute.                                |
| Member reconnects after all disconnected | Lobby becomes searchable again. TTL is restored to 4 hours.                             |
| Last member leaves                       | Lobby is deleted immediately.                                                           |

For more information on what happens when an owner disconnects, see [Ownership changes](/services/playfab/multiplayer/lobby/ownership-changes).

### Server-owned lobbies

| Scenario                     | Behavior                                                                                     |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
| Active with connected server | TTL is 4 hours, reset on each operation. Lobby is searchable.                                |
| Active without connections   | TTL is 1 hour, reset on each operation. Lobby is searchable.                                 |
| Server-owner disconnects     | Lobby is hidden from search. TTL is unaffected.                                              |
| Server-owner reconnects      | Lobby becomes searchable again.                                                              |
| All members disconnect       | No action. The server is not a member, so member disconnections don't affect lobby lifetime. |
| Server leaves                | The server can be replaced by another server claiming ownership.                             |

<Info>
  Server-owned lobbies are not deleted when all player members leave. Only the server owner can delete a server-owned lobby, or it will expire after the TTL runs out.
</Info>

## Extending lobby lifetime beyond the default TTL

The 4-hour idle TTL is intended to be the maximum ordinary expected time a lobby would be left unattended. However, some scenarios—such as server-owned lobbies waiting for players to arrive—may require longer-lived lobbies.

To keep a lobby alive beyond the default TTL, periodically update the lobby before the TTL expires. Any update operation resets the TTL. For example, a game server can update a lobby property at a regular interval to prevent the lobby from expiring.

<Note>
  Any lobby operation resets the TTL, including updating lobby properties, member properties, or search properties.
</Note>

## Search visibility and expiration

Lobby expiration and search visibility are closely related but distinct concepts.

* **Hidden from search** means the lobby won't appear in [FindLobbies](/services/playfab/multiplayer/lobby/find-lobbies) results, but it still exists and can be joined using the connection string.
* **Deleted** means the lobby no longer exists and can't be accessed.

A lobby may be hidden from search but still alive during the grace period after all members disconnect. This design protects against temporary network disruptions—if members quickly reconnect, the lobby is restored without any data loss.

## Summary

| Factor                                          | Value                                     |
| ----------------------------------------------- | ----------------------------------------- |
| Default TTL (no connections)                    | 1 hour                                    |
| Default TTL (with connections)                  | 4 hours                                   |
| TTL after all members disconnect (client-owned) | 1 minute before deletion                  |
| Client-owned lobby, last member leaves          | Deleted immediately                       |
| Server-owned lobby, server disconnects          | Hidden from search, TTL unaffected        |
| TTL reset trigger                               | Any lobby operation (join, update, leave) |

## See also

* [Create a lobby](/services/playfab/multiplayer/lobby/create-a-lobby)
* [Ownership changes](/services/playfab/multiplayer/lobby/ownership-changes)
* [Game servers and lobbies](/services/playfab/multiplayer/lobby/lobby-server-overview)
* [Lobby and matchmaking real-time notifications](/services/playfab/multiplayer/lobby/lobby-and-matchmaking-real-time-messages)
* [Lobby properties](/services/playfab/multiplayer/lobby/lobby-properties)
* [Find lobbies](/services/playfab/multiplayer/lobby/find-lobbies)


## Related topics

- [Renewing a User Store ID key](/publishing/xstore-commerce/xstore-renew-userstoreid.md)
- [Lobby ownership](/services/playfab/multiplayer/lobby/owner-requirements-and-privileges.md)
- [Handling Token Expiration](/services/playfab/sdks/c/relogin.md)
- [LifetimeStateUpdated](/reference/graphics/d3d12/interfaces/id3d12lifetimeowner/methods/id3d12lifetimeowner_lifetimestateupdated_public.md)
- [Create a lobby](/services/playfab/multiplayer/lobby/create-a-lobby.md)
