如何在php中唯一地标识远程计算机? [英] how to identify remote machine uniquely in php?

查看:81
本文介绍了如何在php中唯一地标识远程计算机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在代理服务器环境中唯一地标识远程计算机,我使用了$ _SERVER ['REMOTE_ADDR']但代理网络中的所有计算机都具有相同的IP地址,有什么办法

how to identify remote machine uniquely in proxy server environment, i have used $_SERVER['REMOTE_ADDR'] but all machines in proxy network has same IP Address, is there any way

推荐答案

永远不要依赖来自客户端的信息.在这种情况下,您将遇到简单的网络问题(永远无法确保客户端的IP地址正确),在其他情况下,客户端可能会故意欺骗信息.

Don't ever depend on information that is coming from the client. In this case, you're running up against simple networking problems (you can never be sure the client's IP address is correct), in other cases the client may spoof information on purpose.

如果您需要唯一地标识您的客户,请在他们第一次访问时向他们提供cookie,这是您所能做的最好的事情.

If you need to uniquely identify your clients, hand them a cookie upon their first visit, that's the best you can do.

这篇关于如何在php中唯一地标识远程计算机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆