duanjuhuo8772 2012-03-14 08:18
浏览 55

如何在不强制用户注册的情况下对用户进行身份验证?

I want to make a website that I thought up, but I don't want to have the users register. Instead, I want some sort of unique id that can be retrieved using PHP. This unique ID could be to be with the network they are using, or their computer.

One idea I was thinking of was getting the users HWID and using that. Would that be possible?

Can someone give me the advantages and disadvantages of doing this, and also give me some examples of what I could use?

  • 写回答

1条回答 默认 最新

  • dongyied24121 2012-03-14 08:23
    关注

    What you're describing is very similar to PHP sessions. A user is given a unique ID, and on the server side the unique ID is assigned variables (in the form of the $_SESSION superglobal). The user will then send the unique ID with every request (be it with a cookie or a get variable), and PHP will fetch the variables and set the proper $_SESSION array.

    This is somewhat problematic in terms of security. The session ID can be stolen (over insecure WiFi for instance), and then the server will wrongly identify the attacker as the victim (in case of administration and limited access, this is problematic). Nothing beats a good username/passphrase combo to secure an area.

    If no sensitive information is stored, than by all means sessions are a very good solution.

    See the PHP manual about sessions.


    You should note though, if the user will erase his cookies (if the session ID is transferred via a cookie), or clear the URL from variables (in case of GET variable), the session will expire, and the user will no longer be recognized. A server cannot absolutely identify a client. What if the user would format/switch computers? Or what if he wishes to use your service from another computer? If those are the cases, then you want to use a registration and login system.

    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP