Why is my HTTP_USER_AGENT not always the same?
-
20-09-2019 - |
Question
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.
Solution
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.
OTHER TIPS
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.
Are you using the compatibility mode of IE8 which makes your browser behave like IE7 and present itself as such?