Good morning, I have several computers with the same IP output, how can I get any information that leads me to know which computer came a request? I use C # Asp .Net MVC
Good morning, I have several computers with the same IP output, how can I get any information that leads me to know which computer came a request? I use C # Asp .Net MVC
The solution is to uniquely identify the machine. The problem is that the best way to do this would be to get some hardware information, such as the MAC address of the network adapter or some information about the motherboard.
To do this, you need to install a component in the browser of the machine that is accessing. This is the only way to get more information and build a cookie that is able to provide information about the hardware that is accessing.
It depends a little on how much security you need in this ID.
Differentiating machines without guaranteeing identity
You can use cookies. When there is a request without the cookie, you generate a unique key and log into the cookie. If a machine loses the cookie, a new one will be generated. You will not know which machine it is, but it will not 'confuse' machines.
Differentiate machines by identifying (but not very good)
Take a look at HttpRequestBase.Browser .
Maybe there is some information you can use to distinguish the machines. Browser ID may be one of them.
Another option, although even more vulnerable (any well advanced user could cheat) would be to send the local IP through ajax in its layout
. Obviously in this case the IP would come after the request (at least initial) and you would have to deal with it server side - probably by identifying the machine and registering it in the section.
<script type='text/javascript'>
var yip2=java.net.InetAddress.getLocalHost();
var yip=yip2.getHostAddress();
</script>
Source: Getting local IP address in javascript
Differentiating machines, identifying them securely
A priori the direct way would be to use a component installed on the machine, as Gypsy spoke.