ASP. NET cannot judge the user's login and Session loss in IE10. Solution

Source: Internet
Author: User

Today, I found that when I log on to a website of my company in IE10 and click other menus, the page will automatically exit from the logon page again. Then I checked and found that the HTTP headers sent by IE10, and. AUTH Cookie is okay, but the form authentication mechanism (FormsAuthentication) cannot determine that the user has logged on, and the saved Session will always be lost.

This is ASP. NET 2.0, 3.5, and 4.0 Bugs, because these versions cannot identify the IE10 User-Agent header string, so they cannot identify the User's browser version, leading to ASP. the special function of NET is invalid. The browser does not support Cookies and does not process Cookie-related code. Therefore, the Session ID returned by the server is not saved in the browser, resulting in loss.

This issue has been confirmed by Microsoft. It is a Bug in IE10 and two hotfixes have been released to fix it. If you encounter the same problem, refer to the following instructions:
KB2600088: Hotfix is applicable to ASP. NET in Microsoft. NET Framework 4.0.
KB2608565: Hotfix is applicable to ASP. NET in. NET Framework 3.5.1.
KB2600100: Hotfix is applicable to ASP. NET Framework 3.5 SP1 and. NET Framework 2.0 SP2. NET [English]
A simple solution is to add a browser definition file in the root directory of the website)

The procedure is as follows::
1. Add a "App_Browsers" folder
2. Add a file with the suffix "*. browser", such as IE10.browser.
3. Add the following file:Copy codeThe Code is 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" type = "apiname" text = "apiname"/>
</Capabilities>
</Browser>
</Browsers>

After setting is complete, the problem can be solved.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.