# What's the difference between SessionDisconnect / SessionLogout?

**URL:** <https://forum.heroiclabs.com/t/whats-the-difference-between-sessiondisconnect-sessionlogout/3324>\
**Category:** Runtime Framework\
**Created:** [December 8, 2022, 5:19am UTC](https://forum.heroiclabs.com/t/whats-the-difference-between-sessiondisconnect-sessionlogout/3324 "2022-12-08T05:19:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![renhades](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/renhades/32/96_2.png) [@renhades](https://forum.heroiclabs.com/u/renhades)\
**Post date:** [December 8, 2022, 5:19am UTC](https://forum.heroiclabs.com/t/whats-the-difference-between-sessiondisconnect-sessionlogout/3324/1 "2022-12-08T05:19:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gabriel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/gabriel/32/644_2.png) [@gabriel](https://forum.heroiclabs.com/u/gabriel)\
**Post date:** [December 8, 2022, 7:59am UTC](https://forum.heroiclabs.com/t/whats-the-difference-between-sessiondisconnect-sessionlogout/3324/2 "2022-12-08T07:59:42Z")

</div>

Hi @renhades -

Take a look at our [Session docs](https://heroiclabs.com/docs/nakama/concepts/session/#session-logout), 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](https://heroiclabs.com/docs/nakama/getting-started/configuration/#session.single_socket).

Hope that helps!

---

<div class="post-metadata">

**Author:** ![renhades](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/renhades/32/96_2.png) [@renhades](https://forum.heroiclabs.com/u/renhades)\
**Post date:** [December 22, 2022, 9:45am UTC](https://forum.heroiclabs.com/t/whats-the-difference-between-sessiondisconnect-sessionlogout/3324/3 "2022-12-22T09:45:27Z")

</div>

Thanks for your help!
