Great app btw

So i am integrating chat into an existing system where the user is required to log in.
Once the user logs in, a chat window automatically opens (via popup) and puts the user into the room. This ensures chat is open while the user is working away on our system.
However, if he logs out of our system and then logs back in again, another chat window will open.
Is it possible to get a list of current users to ensure the same user is not attempted to be logged in twice?
Many thanks,
Choast