My website uses sessions for user logins and I would like to have a message on each page showing the user how many computers are logged into their account (like what Gmail does).
For example, if they are logged in on two different computers, I would like the message to say:
You are logged in on 2 computers.
I know how to check if they are logged in -- I just check the $_SESSION['username']
variable and if it's set then they are logged in on that computer. But how can I check if the same username
is set in other sessions (indicating that they are logged in on other computers)?