I want to prevent multiple logins in a php application.
First, I create login status (active, notactive) in a user table.
When user A logs in the user status
What you should do is check on whether they have been active the last several minutes when trying to login. This could be done with a lastonline stamp and should be set on every page request in the user table.
If not done with javascript you could check, when logging on, if the user was active the last 15 minutes. If not you can login as the new user.
You could also do it with javascript. Make an ajax call that fires every minute or so.
Let this call go to a script that will edit the lastonline stamp in the user db. When trying to login you check the user db if the lastonline stamp has exceeded the minute and you have your check if you may login. This will help when you are on the page but you are not active the last 15 minutes and you do not want somebody else to login.