dongliu4320 2014-02-14 11:25
浏览 714
已采纳

Laravel:确保用户一次只能登录一台计算机

I want to ensure that the users can't share the same login/password.

To do this, when a user try to log in i want to check if he is not already connected on a different computer.

My first idea is get all the users having actives sessions, but i don't know how ? Or may be there is a better way ?

  • 写回答

1条回答 默认 最新

  • douyi9597 2014-02-14 11:39
    关注

    You have more things in here:

    • ensuring that the users don't share the same credentials can be done through simple validation
    • checking if user is already logged in can also be done through session - with login,logout methods that the user will trigger.

    You, as developer have total power to manage users per session basis. You can improve design with some events notification, but stateless nature of HTTP protocol gives you limited number of tools for user tracking (except Google machinery :)) What is happening on their local machines in different thing, and out of scope of Laravel app.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?