How to Prevent Concurrent User Logins in PHP/MySQL Site?

后端 未结 6 1639
北恋
北恋 2020-12-16 18:58

I am developing the user management portion of a website that will host a webcast. The goal is to prrevent the same user nam (email address) from being used concurrently.

6条回答
  •  渐次进展
    2020-12-16 19:56

    If it is OK to logout an already logged in user if someone else logs in with the same credentials then you could do the following: when a user logs in generate a random ID in your database for that user and the same in a cookie session. The two must match to authenticate.

提交回复
热议问题