5
votes

I want to check whether if two of my url are fired from same browser and ip

For this i was using user Agent to check and getting ip from request object, it was fine until Firefox but when it comes to IE 7+ Versions, it is weird IE is generating different User Agents for same url's of a web App.

My IE version is 11.0+

For one request i am getting UserAgent like

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; Media Center 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)

Actually i was checking userAgents to perform some bussiness logic based upon userAgents. so mostly i am looking for a solution based on userAgnets.

I think feature detection suggested by MSDN docs won't work here.

Any solution to get same userAgents will be helpful

2
Have you ever thought about using cookies?Kumar
i can't use cookies because both are from different domainssaikiran
usecase??? @HarshaMVsaikiran
@saikiran, what for do you need this? It's a bit weird problem. If you give us more details - maybe a better solution will be suggested.Kiril
this is for some Ad Injection purpose. our clients will validate our clicks based on the click page UserAgent.saikiran

2 Answers

1
votes

You can try to use canvas-fingerprinting.

The idea behind this is that every hardware generates unique sparks on the html-canvas.
By saving and analyzing the generated canvas you can reidentify your user.

Example source code: https://github.com/Valve/fingerprintjs


There is even a testpage here: http://valve.github.io/fingerprintjs/

Scroll down until you see Your browser fingerprint.
Works for me even after changing the UserAgent completely.

0
votes

From the first sight it could be easily solved by writing an appropriate RegEx for each browser. Several rules for Browser detection could be found here. Even all (or most of) available user agents could be found here (e.g. for IE, for Chrome, etc).

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

Event more - there's a third-party API for user agent parsing.

BUT there're tons of browsers and even more browser versions! You'll never be sure that all browsers are covered.