Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my HTTP_USER_AGENT not always the same?

When I print my ENV{'HTTP_USER_AGENT'} at the beginning of each of my perl pages, sometimes it says I'm using IE7 and other times it says I'm using IE8. Any idea why?

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; 
InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; 
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322;
InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

My IE version is actually 8.

like image 723
user105033 Avatar asked Feb 16 '10 14:02

user105033


People also ask

Can 2 devices have the same user agent?

User_agent is the browser+OS version, allowing to distinguish between devices. For example a user is likely to use both phone and laptop, but is unlikely to use windows+apple laptops. It is unlikely that the same session id has multiple useragents.

Can user agents be the same?

If a different person on the Internet with the same configuration accesses your website, then their user agent will be the same.

Is a user agent unique?

User-Agents also provides one of the data points for fingerprinting users without the use of cookies. It's included with every HTTP request and can potentially be very long and unique to a user in certain uncommon situations.

Does Chrome use AppleWebKit?

AppleWebKit/537.36 indicates what browser rendering engine is used. A rendering engine is what transforms HTML into an interactive webpage on the user's screen. The WebKit browser engine was developed by Apple and is primarily used by Safari, Chromium, and all other WebKit-based browsers.


3 Answers

IE 8 will pretend to be IE 7 for backwards compatibility reasons - this is called Compatibility View.

More information: http://msdn.microsoft.com/en-us/library/dd567845%28VS.85%29.aspx

Compatibility View (and therefore an IE 7 user-agent string) is only enabled for specific websites. To view the list, visit

res://iecompat.dll/iecompatdata.xml

Using your IE browser.

like image 187
rjh Avatar answered Sep 29 '22 21:09

rjh


IE8 has an IE7 compatibility mode that allows it to work just like and identify itself as IE7. This is so IE8 maintains backwards compatibility with websites that are designed to use the quirks of IE7 and previous versions of Internet Explorer.

How to make IE8 emulate IE7

like image 42
John Conde Avatar answered Sep 29 '22 22:09

John Conde


Are you using the compatibility mode of IE8 which makes your browser behave like IE7 and present itself as such?

like image 44
Tatu Ulmanen Avatar answered Sep 29 '22 21:09

Tatu Ulmanen