I created a login to my site. After an user logged in I store the user ID and an action (=Logged in) in a database and $_SESSION['loggedin']==TRUE. (if log out the action in DB will Logged out and session will destroyed) If somebody wants to log in again with the same username from a second computer I will not allow it because the last row in the database is 'Logged in' and of course the user ID will the same too. So I do not want to allow multiple connection from one username. Now here I want to put a link: "Disconnect the other connection".
For example: I logged in the school but I forget to logout, then I try to log in at home but it will failed because I am logged in (session is alive) another place so if I click "Disconnect the other connection" link I want to delete the session value in the school (change the action value in DB is not enough because if I change it to Logged out the session is still alive and multiple connection will available)
How can I prevent the multiple connection from one username?