What's the difference between SessionDisconnect / SessionLogout?

Hi,

As the title, I want to implement a feature that the same player is allowed to login “one device” at the same time. If the player login with second device, then that action will kick previous login device and show hint message.

I checkouted the Nakama documentation and found these 2 similar functionalities. What’s the difference between them? Which of them is recommended to achieve “kick-previous-login” feature?

Thanks in advance.

Hi @renhades -

Take a look at our Session docs, it’s described there:

Logging out of a user’s session invalidates their authentication and refresh tokens, but does not disconnect their open socket connections. This can be accomplished via the server-side sessionDisconnect function.

For your use case, also have a look at the single_socket configuration.

Hope that helps!

1 Like

Thanks for your help!