Question

I've recently noticed that some websites that I visit are capable of detecting the device that I am using to view the website but I'm not sure how they are able to do that.

For example, www.rdio.com, a music streaming application, offers two different services; one for mobile devices and one for laptops and desktop computers. They charge $10/month for mobile devices and $5/month for desktops and laptops.

Obviously they must have a pretty good method for detecting the device that's sending requests as part of their business model depends on it. How do rdio and other companies achieve this? Everything I've thought of so far seems pretty bad. For example, if they depend on header variables in the http requests how do they guard against spoofing? Or if they use javascript on the client side to examine browser features, which features can you examine to accurately determine the device type? Do you look at screen resolution, or the presence of a gyroscope or something, because what if I have a mobile device with laptop style resolution, or a laptop with a gyroscope?

What features of the HTTP requests or the browsers do webservers examine in order to accurately determine the device type?

Was it helpful?

Solution

They depend upon the User-Agent of the browser to determine which kind of device the client is using.

Of course, User-Agents can be spoofed, and there isn't much that you can do to prevent it.

While there have been attempts to detect the real browser types by trying to invoke features that are specific to those browsers, this isn't reliable.

You can read more about User-Agent here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top