title: How to prevent multiple logins in PHP website
body: <p>I want to prevent multiple logins in a php application.</p>
  
  <p>First, I create login status (active, notactive) in a user table.</p>
  
  <p>When user A logs in the user status will be set to 'active', and if the user logs out the status will set to 'notactive'.  When another client trys to login using the same user acount, I check the user table.  If the user is still active the error login will be sent to the user.</p>
  
  <p>The problem occurred, if the user closes the browser the status in user table can be update because the user didn't click logout.</p>
  
  <p>Do you have any suggestion about this?</p>