Solve the problem that the form authentication cannot be logged in IIS7 after ASP.net upgrade

Source: Internet
Author: User

The Web application developed by ASP.net 1.1 is released through IIS7 after upgrading to 2.0 or 3.5.

The authentication method in the procedure adopts form attestation, the code of Web.config file is as follows:

<authentication mode= "Forms" >

<forms loginurl= "pages\systempage\login\logon.aspx" 

. Aduauth "protection=" All ">

</forms>

</authentication>

"Problem-encountered phenomenon"

After authentication login, the program always displays the login page logon.aspx

Through the program tracking, found in the Logon.aspx.cs

SetAuthCookie () and RedirectFromLoginPage ()

Invalid after execution, cannot change request.isauthenticated value, always false;

"Solution"

Run IIS7-> the Web program-> authentication-> form Authentication-> Edit-> cookie Settings-> Use cookies-> applications.

After making such modifications, the Web.config file is automatically modified to:

<authentication mode= "Forms" >

<forms cookieless= "usecookies" loginurl= "pages\systempage\login\" 

Logon.aspx "Name=". Aduauth " 

protection=" All ">
</forms>

</authentication>

Run the program again, the problem is resolved, the program can log on normally.

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.