Website - nearly same clients, different informations
There are two (or more) computers on LAN with internet access.
They have the开发者_运维问答 same:
They are visiting my webpage which can use js and php to retrive informations.
Is there any way I can find differences between these clients with retrived information? Which informations are different?
Set a (random valued) cookie or a session.
The two machines will have unique identities.
Their IP addresses would be different, unless they're using a proxy and/or NAT firewall. That information can be retrieved trivially via $_SERVER['REMOTE_ADDR']
. There may an X-Forwarded-For
header that some proxies might put in place, revealing the internal address, but it's not guaranteed to be there, and definitely not guaranteed to be reliable.
There's a few client-side tricks you can use to get machine's local address, but again, if they're behind a NAT firewall and/or proxy, there's no guaranteed that both machines aren't on two seperate networks and both coincidentally have the same private IP address.
精彩评论