Level 75
Yes a status flag is one way of doing that. Should be alright. Also see https://stackoverflow.com/questions/1727919/how-to-prevent-multiple-logins-in-php-website
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am making website and I want the user to login on just one device....
I was thinking to add extra column in the database to set it to "active" when login and "not active" when logout and depend on it at each login process....
Is this good way to do that ... or there is a better and optimized solution ?
Yes a status flag is one way of doing that. Should be alright. Also see https://stackoverflow.com/questions/1727919/how-to-prevent-multiple-logins-in-php-website
Please or to participate in this conversation.