The long ID on the server is tied to your connection, not to your username. If your client is connected, then es.engine.connected (in whatever syntax you use) should return true. That doesn't tell you whether you are already logged in however your client should know whether it has already gotten a successful LoginResponse or not. If the connection drops, then you have to create a fresh instance of ElectroServer and a fresh connection, which will give you a different long client ID and you will avoid the problem that you got before.