title: FormsAuthentication redirecting to login page
body: <p>I'm trying to implement <code>Simple FormsAuthentication</code> in an <code>ASP.NET</code> <b>MVC5</b> application as: </p>
  
  <p><b>Controller</b></p>
  
  <pre><code>public ViewResult login()
  {
      return View();
  }
  
  [HttpPost]
  public ViewResult login(Login login)
  {            
      if (ModelState.IsValid)
      {
          if (FormsAuthentication.Authenticate(login.username, login.password))
          {
              FormsAuthentication.RedirectFromLoginPage(login.username, false);                 
          }
          else
          {
              Response.Write("Invalid username or password. Try again");
              return View();
          }
       }
       return View("Index");            
  }
  </code></pre>
  
  <p><b>Web.Config</b></p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="owin:AutomaticAppStartup" value="false"/&gt;
  &lt;/appSettings&gt;
  &lt;system.web&gt;    
      &lt;authentication mode="Forms"&gt;
            &lt;forms
                name="PC"
                loginUrl="~/Home/login"
                timeout="2"&gt;
            &lt;credentials&gt;
                &lt;user name="admin" password="admin1"/&gt;
            &lt;/credentials&gt;
    &lt;/forms&gt;
  &lt;/authentication&gt;
  &lt;authorization&gt;
    &lt;deny users="?"/&gt;
  &lt;/authorization&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>Now when I supply correct credentials as mentioned in <code>Web.Config</code> file, error message from the <code>Else</code> statement part of <code>PostHttp login ViewResult</code> executes and writes message
  <code>Invalid username or password. Try again</code> 
  and redirects to login page again. URL shown in the browser is: </p>
  
  <p><code>http://payroll.net:81/Home/login?ReturnUrl=%2f</code> </p>
  
  <p>Any idea why FormsAuthentication is not redirecting to "Index" View after receiving correct credentials?  </p>