Home >Backend Development >C#.Net Tutorial >ASP.NET cannot determine that the user is logged in and the session is lost in IE10. Solution
Today I found that when I log in to one of my company's websites in IE10 and click on other menus, the page will always automatically exit to the login page. After checking, I found that the HTTP headers and .AUTH Cookies sent by IE10 are fine, but using The form authentication mechanism (FormsAuthentication) cannot determine that the user has logged in, and the saved Session is always lost.
Afterwards, it was found that this is a bug in ASP.NET 2.0, 3.5 and 4.0, because these versions cannot recognize the User of IE10 -Agent header string, so the version of the user's browser cannot be identified, which leads to the failure of specific functions of ASP.NET. It is believed that the browser does not support the Cookies function and does not process Cookie-related code, etc., thus causing the browser to fail. The Session ID returned by the server is not saved in the server, resulting in loss, etc.
This problem has been officially confirmed by Microsoft and is a bug of IE10. Two HOTFIX have also been released specifically to fix this problem. If you encounter this problem, For the same problem, please refer to the following instructions:
KB2600088: Hotfix applies to ASP.NET in Microsoft.NET Framework 4.0 [English]
KB2608565: Hotfix applies to ASP.NET in .NET Framework 3.5.1 [ English]
KB2600100: Hotfix applies to ASP.NET in .NET Framework 3.5 SP1 and .NET Framework 2.0 SP2 [English]
The simple solution is to add a browser definition file in the root directory of the website (browser definition file)
The steps are as follows:
1. Add an "App_Browsers" folder
2. Add a file with the "*.browser" suffix, such as IE10.browser.
3. Add the file content as follows:
<browsers> <browser refID="Default"> <capabilities><!-- To avoid wrong detections of e.g. IE10 --> <capability name="cookies" value="true" /> <capability name="ecmascriptversion" value="3.0" /> </capabilities> </browser> </browsers>
For more related articles on how ASP.NET cannot determine that the user has logged in and the session is lost in IE10, please pay attention to the PHP Chinese website!