I found a script which allows users to register to a site, by storing a username
and password in a database table.
The script already creates a session, but this only lets my webpages know who is logged in.
I would like to know how to prevent a user logging in, when they are already logged in somewhere else.
I thought maybe setting a field in the user record when they are logged in( set to '1') . But then the only time that field would be set to 0 is if the user used the logout page. If they just exited the browser, my table would still have them as logged in.
Much appreciated