Wednesday, June 25, 2014

IIS7 / .NET / Cookie Issue

Long time no post, but hoping to change that with shorter, more matter-of-fact items being posted here...

Anyways, today we ran into a problem that probably has been around for a while, but really came to light with a feature we added to our site.  We noticed that sessions were not being sticky when someone closed and re-opened Internet Explorer 11, after a bit of testing and doing a fair amount of Google searches we came up with the culprit being .NET only having version 2 installed on our server.  We have no real need for .NET, but there was a change in the user agent string in IE 11 that requires you to either patch your older version of .NET or install a new version of .NET.

Essentially, previous version or unpatched versions of .NET in IIS use a pattern matching string to detect which browser you have and whether you can accept cookies or not.  Due to the change in the IE11 user agent, this no longer worked and made IE11 default to a cookieless browser, thus it no longer stored cookies, which when you have a site that relies on them is pretty important.  Way to go Microsoft!

Anywhoo, the path to correcting this is easy enough, install .NET 4.5, reboot, patch, reboot, and maybe patch again...

Here is the article that led up down the path to figuring this out: http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx