Prevent users to login at the same time with same username

0 votes
Hi All

As the title implies I am trying to prevent that problem. There are some topics opened before on this problem like here . I follow that way. But what is wrong is that: when application close I should setAttribute for "loginStatus" to "false"(session service) so that another device can go on login to game. I call setAttribute API inside OnApplicationQuit() method of unity3d(I am closing app using harware home button). However, it does not setAttribute to false since we call it just while application quit. So I cannot login from another device. However, when I call setAttribute API inside in game exit button, it sets the attribute to false and everything works. So what should I do here?

asked Sep 27, 2016 in Unity by gokhan (20 points)

1 Answer

0 votes
Best answer
Hi Gokhan,

In that case, you can prompt a message to the user by saying that you already login on another device. Please clear your session or log out etc to log in into this device. If he/she still wants to login in this phone then first validate his profile details according to the details which you have stored. Once he/she provide the details update his loginStatus in attribute and redirect him into game screen.


Let me know if you need any other help from our side.



Himanshu Sharma
answered Sep 27, 2016 by hs00105 (2,005 points)
selected Sep 28, 2016 by gokhan
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on