title: Why does my asp.net membership login page not work with a redirect?
body: <p>I have this membership site setup on my local machine using the ASP.NET membership provider.  When I go to:</p>
  
  <p><a href="http://localhost/admin/" rel="nofollow noreferrer">http://localhost/admin/</a></p>
  
  <p>It redirects me to </p>
  
  <p><a href="http://localhost/Login.aspx?ReturnUrl=%2fadmin%2fDefault.aspx" rel="nofollow noreferrer">http://localhost/Login.aspx?ReturnUrl=%2fadmin%2fDefault.aspx</a></p>
  
  <p>Which is fine.  But after I put in my login information, the page just seems to refresh.  It doesn't actually log me in, and it just looks like it refreshes the page.  If I change the URL to:</p>
  
  <p><a href="http://localhost/Login.aspx" rel="nofollow noreferrer">http://localhost/Login.aspx</a></p>
  
  <p>It works fine.  It logs me in no problem, and redirects me to my default page.  I also checked the live site and it does the same thing.  Any ideas?  Thanks in advance!</p>
  
  <p>EDIT:  Here is the markup:</p>
  
  <pre><code>&lt;asp:Login ID="Login1" runat="server" CssClass="LoginBox" TitleText="Please Log In"&gt;
      &lt;LayoutTemplate&gt;
          &lt;h2&gt;
              Please Log In:&lt;/h2&gt;
          &lt;p runat="server" id="FailureText" visible="false"&gt;
              Either your email address or password was incorrect. Please try again.&lt;/p&gt;
          &lt;strong&gt;Email&lt;/strong&gt;&lt;br /&gt;
          &lt;asp:TextBox ID="UserName" runat="server"&gt;&lt;/asp:TextBox&gt;
          &lt;asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
              Text="*"&gt;&lt;/asp:RequiredFieldValidator&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;strong&gt;Password&lt;/strong&gt;&lt;br /&gt;
              &lt;asp:TextBox ID="Password" runat="server" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                  Text="*"&gt;&lt;/asp:RequiredFieldValidator&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;asp:Button ID="Login" CommandName="Login" runat="server" Text="Log In" /&gt;&lt;/p&gt;
          &lt;p&gt;
              Please &lt;a runat="server" id="Link_ContactUs"&gt;contact &lt;/a&gt;an administrator if you
              are having trouble logging in or have forgotten your password.&lt;/p&gt;
      &lt;/LayoutTemplate&gt;
  &lt;/asp:Login&gt;
  </code></pre>
  
  <p>web.config setup:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms loginUrl="/Login.aspx"
           protection="All"
           timeout="60"
           name="AppNameCookie"
           path="/Admin"
           requireSSL="false"
           slidingExpiration="true"
           defaultUrl="/Admin/Default.aspx"
           cookieless="UseCookies"
           enableCrossAppRedirects="false" /&gt;
  &lt;/authentication&gt;
  </code></pre>