Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alfrednutile's avatar

Solution to make it so a user can only have one session at a time

The company I am doing work for wants the user to only log in from one computer/browser at a time. I was given this link on stack overflow http://stackoverflow.com/questions/1727919/how-to-prevent-multiple-logins-in-php-website but was hoping to find a more vetted solution.

Thanks

0 likes
3 replies
pmall's avatar

I saw taylor twitter in 5.2 the user_id will be stored in the sessions table with the database driver. So I guess you would check if there is already a session for the user wanting to log in.

Please or to participate in this conversation.