hello i want to make system website like yahoo messenger using PHP.
here the catch: when i (as user X) logged in computer A then i logged in computer B.
The User X in computer A must be forced to log out.
But i don’t want use session time. because user can log in every time.
Must i record to database mysql?
Thanks in advance for any help, and I’m really sorry if this has been asked before.
Indeed, you will need to store your sessions in the database.
For each request, check if the database session hasn’t expired. If it has, log the user out.
Now, if a user already has an active session in the database (from another computer), invalidate/expire it. The next request on the other computer will log the user out. The sessions shouldn’t collide because the new session will have a different session ID.