PHP - How to prevent user from logging in from multiple machines at the same time?

前端 未结 5 456
情书的邮戳
情书的邮戳 2020-12-22 07:30

Is there a way that I can prevent a user from logging into a system from different machines at the same time?

Thank you

5条回答
  •  悲&欢浪女
    2020-12-22 08:09

    You could try storing the users' IP address in the database when the login and clear that IP when they logout (or you log them out). If a user attempts to login but they already have a different IP stored in the database that could be an indication that they are logging in from 2 different machines....not 100% accurate but may sorta work

提交回复
热议问题