Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 320517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:45:39+00:00 2026-05-12T08:45:39+00:00

I am trying to configure authentication using a few tutorials I have found on

  • 0

I am trying to configure authentication using a few tutorials I have found on the Membership Providers paradigm found in ASP.NET v2.0. I’ve followed the examples in the tutorial but can’t seem to get the FormsAuthentication.RedirectFromPage method to work appropriately. When I attempt a login, the user credentials are validated via Membership.ValidateUser but the page is sent back to Login.aspx instead of Default.aspx. Here is the relevant snippet from my web.config:

...
<authentication mode="Forms">
  <forms loginUrl="Login.aspx" protection="All" timeout="60" name="POTOKCookie" requireSSL="false" path="/FormsAuth"
         slidingExpiration="true" cookieless="UseCookies" enableCrossAppRedirects="false" defaultUrl="~/Default.aspx"/>
</authentication>
<authorization>
  <deny users="?" />
</authorization>
...
<membership defaultProvider="CustomizedProvider">
  <providers>
    <clear />
    <add name="CustomizedProvider"
         type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
         connectionStringName="LoginDB2"
         applicationName="POTOK"
         minRequiredPasswordLength="5"
         minRequiredNonalphanumericCharacters="0" />
  </providers>
</membership>

I’ve verified that my connection string is correct (since Membership.ValidateUser seems to be working just fine) and am using the ASP.NET Login control for the UI on my Login.aspx page. Here is the authenticate event handler code:

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
    If (Membership.ValidateUser(Login1.UserName, Login1.Password)) Then
        FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet)
    End If
End Sub

When I visit the url (http://localhost/Project) I am taken to: http://localhost/Project/Login.aspx and after the “login” my url is: http://localhost/Project/Login.aspx?ReturnUrl=%2fProject%2fDefault.aspx

Did I miss a configuration step?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:45:39+00:00Added an answer on May 12, 2026 at 8:45 am

    The problem is in path=”/FormsAuth” parameter.
    Remove this variable and try again

    Read this post about why path can be wrong

    From MSDN:
    path – Optional attribute. Specifies the path for cookies that are issued by the application. The default is a slash (/), because most browsers are case-sensitive and will not send cookies back, if there is a path case mismatch.

    NOTE: The path attribute is case sensitive. Therefore, if the you set the value of the path attribute to /application1, and if the application name is Application1, the authentication cookie path is /application1.

    So if you want to use path property, you should set it to “/project” because Project is the name of your application (as far as I understood). But I don’t think you need to have different paths when you use different cookies names (i.e. name=”POTOKCookie” in this application, i hope will be different from other ASP.NET applications installed on the same host)

    See PRB: Forms Authentication Requests Are Not Directed to loginUrl Page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup Forms Authentication in an asp.net mvc 2 application that will
edit updated with new information I've been trying to configure a ASP.Net site to
I am trying to configure some basic HTTP authentication over HTTPS using the spring
I am using OmniAuth gem for Twitter authentication, i am trying to configure force_login
I have an asp.net app, I am using vs 2010, and I connect to
I have a Windows service written using Topshelf . I'm trying to configure it
I'm trying to configure a dedicated server that runs ASP.NET to send mail through
I have a C# ASP.NET web application an I am trying to populate an
I'm trying configure Request-Header Authentication using spring 2.0 security, and I'm a complete newbie
Im trying to configure a .htaccess RewriteRule and i'm struggling. I have a domain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.