title: Asp.net core Identity successful login redirecting back to login page
body: <p>I have a problem where the asp.net identity framework is redirecting the user back to the login page after they have logged in successfully. </p>
  
  <p>This is using the standard Asp.net Core Identity. It is the version 2.1.1. The scaffolding that generates the razor pages. Not sure if that is significant.</p>
  
  <p>I know the user is successfully logging in because I get the log message</p>
  
  <blockquote>
    <p>...Areas.Identity.Pages.Account.LoginModel: Information: User logged in.</p>
  </blockquote>
  
  <p>But then it redirects straight back to the login page. </p>
  
  <p>If I use fiddler I can see that there is a cookie on the request so it all looks good from that perspective.</p>
  
  <pre class="lang-none prettyprint-override"><code>.AspNetCore.Identity.Application=CfDJ8KJxkuir9ZJIjFLCU2bzm9n6X...
  </code></pre>
  
  <p>So I guess the middleware that is handling the authentication but not accepting the cookie? </p>
  
  <p>If I could see what the actual middleware for the auth was doing I might have an idea but I can't find it.</p>
  
  <p>Any help appreciated</p>