title: User.Identity.IsAuthenticated always returns false even after successfully logged in using PasswordSignInAsync in asp.net core 2.2
body: <p>Whenever i hit Login the user is Signed in using signinManager.PasswordSignInAsync and result.Succeeded is true. The problem is that if i Call Login second time the user does not presist. User.Identity.IsAuthenticated should be true next time but it is always false </p>
  
  <pre><code> [HttpGet("[action]")]
      public async Task&lt;IActionResult&gt; Login()
      {
          try
          {
              if (User.Identity.IsAuthenticated)
              {
                  Console.WriteLine("You are alredy Logged In...................");
                  var claims = User.Claims;
                  return Ok("Authenticated");
  
              }
              else
              {
  
  
                  var result = await signinManager.PasswordSignInAsync("myEmail.com", "Password", true, true);
                  if (result.Succeeded)
                  {
  
                      Console.WriteLine("Logged in successfully....");
  
                  }
                  return Ok("Logged in successfully ");
              }
  
  
          }
          catch (System.Exception e)
          {
              Console.WriteLine("........................................" +e.Message);
              return Ok(e.Message);
              throw;
          }
  
  
      }
  </code></pre>
  
  <p>ConfigureServices in StartUp.Cs looks like </p>
  
  <pre><code>   public void ConfigureServices(IServiceCollection services)
      {
  
          services.AddDbContext&lt;DbContextBase&gt;(options =&gt;
     options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
          services.AddIdentity&lt;AppUser, IdentityRole&gt;()
      .AddEntityFrameworkStores&lt;DbContextBase&gt;()
      .AddDefaultTokenProviders();
  
  
          services.AddMvc();
      }
  </code></pre>
  
  <p>and Configure Method in Startup.cs looks like:</p>
  
  <pre><code> public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
              {
                  HotModuleReplacement = true
              });
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseStaticFiles();
          app.UseAuthentication();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
  
              routes.MapSpaFallbackRoute(
                  name: "spa-fallback",
                  defaults: new { controller = "Home", action = "Index" });
          });
      }
  </code></pre>
  
  <p>The Login Method must return "Authenticated" when hit second time.</p>