ASP. NET session loss problem form authentication mechanism (formsauthentication), but the user cannot be judged to have logged on

Source: Internet
Author: User
Session loss in ie10 has aroused the attention of many people in the industry. Today, when I log on to the website in ie10, the form authentication mechanism (formsauthentication) cannot determine whether the user has logged on, the saved session will always be lost. This article will introduce the solution. If you are interested, you can refer to it. It may be helpful for you to find that when you log on to a website of our company in ie10 today, when you click other menus, the page will automatically exit the logon page again. Then, check and find 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:CopyCodeThe 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.