# Log in from multiple devices (/en/realtime-media/im/build/moderate-and-manage-client-behavior/multiple-device-login/unity)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Agora Chat supports logging in to the same account from up to 4 devices at the same time by default. You can increase the number of
    devices per platform up to 10 by going to **Agora Console > Project management > Relevant project > Agora Chat configuration > Features > Multi Device**.

    In cases of multiple device login, all logged-in devices synchronize the following information and operations:

    * Messages, including online messages, offline messages, push notifications (if the third-party push service is enabled, the offline device receives it), the corresponding receipts and read status, and so on;
    * Friends and group-related operations;
    * Message-thread-related operations;
    * Conversation-related operations.

    The following table summarizes the strategy of forcing other devices to log out and the automatic login security check in the single-device and multi-device login use-cases:

    Single/multi-device login
    Forced logout strategy
    Automatic login security check

    Single-device login
    The newly logged-in device will force the current device to log out. The logged-out device will receive the `AgoraChatClientDelegate#userAccountDidLoginFromOtherDevice` event.
    For devices that log in automatically, the device will automatically reconnect to the Agora server after going offline. If the reconnection is successful, the current logged-in device will be forced to log out by default (for multiple devices, the earliest logged-in device will be logged out). If you want to keep the current device logged in, contact [support@agora.io](mailto\:support@agora.io). In this use-case, the device that logs in automatically won't be able to log in and will receive error 214, indicating that the number of currently logged-in devices exceeds the limit.

    Multi-device login
    If the number of logged-in devices on one end reaches the limit, the device that logged in the latest will force the device that logged in the earliest to log out. The logged-out device will receive the `AgoraChatClientDelegate#userAccountDidLoginFromOtherDevice` event. Agora Chat only supports forced logout for the devices on the same end.

    | Single/multi-device login |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Forced logout strategy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    | :-----------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
    |    Single-device login    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The newly logged-in device will force the current device to log out. The logged-out device will receive the `onDisconnected` event.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
    |     Multi-device login    | If the number of logged-in devices on one end reaches the limit, the device that logged in the latest will force the device that logged in the earliest to log out. Agora Chat only supports forced logout for the devices on the same end. When multiple ends are logged in, the use of a fixed device ID affects the forced logout strategy. The SDK generates an ID as the unique device identifier. Previously, the SDK used a different random string as the device identifier for each opened tab. Starting from v1.3.1, the SDK has the `ConnectionParameters#isFixedDeviceId` parameter, which you can set to use a random device ID or a fixed device ID when initializing the SDK: - (Default) `true`: Use a fixed device ID. The device ID is stored in local storage. Even when multiple devices are logged in, only one tab can be opened in the same browser. If two are opened, the new tab will force the previous one offline. - `false`: Use a random device ID. Each tab uses a different device ID. When logging in with multiple devices, a user can open multiple tabs in the same browser. If the number of devices exceeds the set number, the newly opened tab will force the first opened tab offline. |

    The Agora server provides a RESTful interface to force a specified account to [log out from a single device](/en/api-reference/api-ref/im/user-system-registration#forcing-a-user-offline).

    Single/multi-device login
    Forced logout strategy
    Automatic login security check

    Single-device login
    The newly logged-in device will force the current device to log out. The logged-out device will receive the `ConnectionEventHandler#onUserDidLoginTooManyDevice` event.
    For devices that log in automatically, the device will automatically reconnect to the Agora server after going offline. If the reconnection is successful, the current logged-in device will be forced to log out by default (for multiple devices, the earliest logged-in device will be logged out). If you want to keep the current device logged in, contact [support@agora.io](mailto\:support@agora.io). In this use-case, the device that logs in automatically won't be able to log in and will receive error 214, indicating that the number of currently logged-in devices exceeds the limit.

    Multi-device login
    If the number of logged-in devices on one end reaches the limit, the device that logged in the latest will force the device that logged in the earliest to log out. The logged-out device will receive the `ConnectionEventHandler#onUserDidLoginTooManyDevice` event. Agora Chat only supports forced logout for the devices on the same end.

    Single/multi-device login
    Forced logout strategy
    Automatic login security check

    Single-device login
    The newly logged-in device will force the current device to log out. The logged-out device will receive the `ChatConnectEventListener#onUserDidLoginFromOtherDevice` event.
    For devices that log in automatically, the device will automatically reconnect to the Agora server after going offline. If the reconnection is successful, the current logged-in device will be forced to log out by default (for multiple devices, the earliest logged-in device will be logged out). If you want to keep the current device logged in, contact [support@agora.io](mailto\:support@agora.io). In this use-case, the device that logs in automatically won't be able to log in and will receive error 214, indicating that the number of currently logged-in devices exceeds the limit.

    Multi-device login
    If the number of logged-in devices on one end reaches the limit, the device that logged in the latest will force the device that logged in the earliest to log out. The logged-out device will receive the `ChatConnectEventListener#onUserDidLoginFromOtherDevice` event. Agora Chat only supports forced logout for the devices on the same end.

    ## Understand the tech [#understand-the-tech-6]

    During initialization, the SDK generates a login ID to identify the device when multiple devices log in and push messages, and sends this ID to the server. The server automatically sends new messages to the user's logged-in device, monitors operations on other devices, and synchronizes multiple devices. The SDK provides the following multi-device use-case functions:

    * Get the login ID list of the other logged-in devices of the current user;

    * Get the list of online logged-in devices of the specified account;

    * Force the specified account to log out from a single device;

    * Force the specified account to log out from all devices;

    * Get operations on other devices.

    * Set the name of the login device;

    * Set the platform of the login device;

    * Get notified about multi-device synchronization.

    Chat SDK generates a new unique login ID every time a user logs in and sends the ID to the server. The server automatically sends new messages to the device where the user logs in, and can automatically monitor friend or group operations on other devices.

    ## Prerequisites [#prerequisites-6]

    Before starting this procedure, initialize and connect the SDK to the server. See [SDK quickstart](../../get-started-sdk) for details.

    ## Implement multi-device login [#implement-multi-device-login-6]

    
  
