How can i do so only 1 can be online for the 1 user at the time? Idea ?
So you e.g can not login to User1 on one pc/browser and then on the other pc/browser login to
I assume you save users in a database, add an active_session field, update it upon login, and check it on requests to ensure that current user session id matches the last one stored in the database.
On Login:
UPDATE `users` SET `active_session`='$session_id';
When user goes to a page that requires login, you search that value:
SELECT * FROM users WHERE `active_session`='$session_id';
this way, if the user signs in other place, the previous session key gets overwriten, and the SELECT above returns an empty resultset.