How to check that two different pages or url issued from the same browser and ip

I want to check if two of my url are running from the same browser and ip

To do this, I used the User Agent to check and get the ip from the request object, this was fine before Firefox, but when it comes to IE 7+ versions , this weird IE generates different User Agents for the same web application URL.

My version of IE is 11.0 +

For a single request, I get a UserAgent as

Mozilla / 5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident / 5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E)

And for another request:

Mozilla / 5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident / 5.0)

In fact, I tested userAgents to execute some business logic based on userAgents . so basically I'm looking for a solution based on userAgnets.

I think the discovery feature suggested by MSDN docs will not work here.

Any solution to get the same userAgents would be helpful

+5
source share
2 answers

At first glance, it could be easily solved by writing the appropriate RegEx for each browser. Several browser discovery rules can be found here . Even all (or most) of the available user agents can be found here (for example, for IE , for Chrome , etc.).

So, let's say for the IE RegEx browser it could be: MSIE[^;,)]+ .
For Chrome, it should be Chrome[^;,)\s]+ , similar to FireFox : Firefox[^;,)\s]+ .

The event is larger - there is a third-party API for parsing the user agent.

BUT there are many browsers and even more browser versions! You will never be sure that all browsers are covered.

0
source

You can try using fingerprints on canvas.

The idea is that each equipment generates unique sparks on an html canvas.
By storing and analyzing the generated canvas, you can re-identify your user.

Source code example: https://github.com/Valve/fingerprintjs


There is even a test page here: http://valve.imtqy.com/fingerprintjs/

Scroll down until you see Your browser fingerprint .
Works for me even after a complete change to UserAgent.

+1
source

Source: https://habr.com/ru/post/1207872/


All Articles