Saturday, December 7, 2013

How to fix Session Cookie Problems in IE11

Problem

We had built website in MVC3 before 1 year and deployed on IIS 6. It was tested with all browsers like IE (7,8,9,10), Firefox and Google Chrome. All function are running perfectly.

Yesterday we noticed weird problem with IE 11. User can't login to site on IE 11. Then again we checked with all browsers but this problems is occurred with IE 11 only.

After goggling and reads blogs we find solution for same. We changed below source in web.config

Solution

<authentication mode="Forms">
  <forms loginUrl="~/YourLoginUrl" timeout="2880" cookieless="UseCookies" />
</authentication>

We have add cookieless="UseCookies" to forms tag and problems is resolved.


We like to know Why it is happened?


The problem rests with some IIS instances thinking that IE11 is a cookieless browser (i.e. cant support cookies). In our problem case the server was setting the authentication cookie and sending it back to the browser, but was then ignoring the cookie on subsequent requests.

The solution is to either patch the browser capabilities so that it knows IE11 can do cookies (outlined in another answer on this page), or change the default behavior to force it to use cookies even if it thinks the browser can’t do cookies.

So, We need to just added the following to our forms section in web.config:
cookieless="UseCookies"



Reference :