title: asp.net core 2.2 redirects to login after successful sign in
body: <ul>
  <li>I updated my visual studio 2017 to the latest 15.9.5.</li>
  </ul>
  
  <p>I have created an out the box asp.net core 2.2 web mvc project with individual user accounts. I set the db up (update-database from package manager console) and ran the site in IIS Express. All good to this point. Registered a user and could sign in.</p>
  
  <p>Deployed the app to IIS - running as an application under the default site and its stuck redirecting back to the login page after successfully signing in.
  (All deployed correctly - app = no managed code)</p>
  
  <p>So I commit the project to a bit bucket repo and ask a friend to try this on their machine. With IIS Express and the database I have given him it's stuck - redirecting back to login after successful sign.</p>
  
  <p>No custom code - all scaffolded code.</p>
  
  <pre><code>public class Startup
  {
      public Startup(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      public IConfiguration Configuration { get; }
  
      // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)
      {
          services.Configure&lt;CookiePolicyOptions&gt;(options =&gt;
          {
              // This lambda determines whether user consent for non-essential cookies is needed for a given request.
              options.CheckConsentNeeded = context =&gt; true;
              options.MinimumSameSitePolicy = SameSiteMode.None;
          });
  
          services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
              options.UseSqlServer(
                  Configuration.GetConnectionString("DefaultConnection")));
          services.AddDefaultIdentity&lt;IdentityUser&gt;()
              .AddDefaultUI(UIFramework.Bootstrap4)
              .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();
  
          services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
      }
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseDatabaseErrorPage();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
              // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
              app.UseHsts();
          }
  
          app.UseHttpsRedirection();
          app.UseStaticFiles();
          app.UseCookiePolicy();
  
          app.UseAuthentication();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
          });
      }
  }
  </code></pre>
  
  <p>}</p>