title: SignInManager.IsSignedIn(User) returns false
body: <p>I’m working on a ASP.NET Core 3.1 Web Application project. I’ve used identity for authentication and I’ve installed <code>Microsoft.AspNetCore.Identity.EntityFrameworkCore</code> package on the project.
  Login code has been implemented like this:</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; Login(LoginDto login, string returnUrl)
          {
              ViewData["ReturnUrl"] = returnUrl;
              if (ModelState.IsValid)
              {
                  var result =
                      await _signInManager
                      .PasswordSignInAsync(login.Email, login.Password, login.RememberMe, false);
  
                  if (result.Succeeded)
                  {
                      if (Url.IsLocalUrl(returnUrl))
                      {
                          return Redirect(returnUrl);
                      }
                      else
                      {
                          return RedirectToAction("Index","Home");
                      }
                  }
                  else
                      ModelState.AddModelError(string.Empty, "Invalid login attemp.");
              }
  
              return View(login);
          }
  </code></pre>
  
  <p>And here’s how startup’s config is like:</p>
  
  <pre><code> public void ConfigureServices(IServiceCollection services)
          { 
          services.AddDbContext&lt;IdentityDbContext&gt;
              (options =&gt; options.UseSqlServer(Configuration.GetConnectionString("MusicTutorialIdentityConnection")
              , optionsBuilder =&gt;
           optionsBuilder.MigrationsAssembly("MusicTutorial.Mvc"))); 
  
              services.AddIdentity&lt;IdentityUser, IdentityRole&gt;()
                  .AddEntityFrameworkStores&lt;IdentityDbContext&gt;()
                  .AddDefaultTokenProviders();
  
          }
   public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
              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.UseRouting();
  
              app.UseAuthorization();
  
              app.UseEndpoints(endpoints =&gt;
              {
                  endpoints.MapControllerRoute(
                      name: "default",
                      pattern: "{controller=Home}/{action=Index}/{id?}");
              });
          }
  </code></pre>
  
  <p>The problem is that <code>SignInManager.IsSignedIn(User)</code> always returns false when I try to log in.
  Here are the<code>_layout.chHtml</code> codes where this method is called: </p>
  
  <pre><code>&lt;header&gt;
          &lt;nav class="navbar navbar-expand-lg"&gt;
              &lt;a class="navbar-brand" href="#"&gt;
                  &lt;img src="images/logo1.png"&gt;
              &lt;/a&gt;
              &lt;form class="form-inline my-2 my-lg-0 col-xs-12"&gt;
                  &lt;input class="form-control mr-sm-2" type="search" placeholder="چه چیزی میخوای یاد بگیری" aria-label="Search"&gt;
                  &lt;button class="btn btn-primary my-2 my-sm-0" type="submit"&gt;جستجو&lt;/button&gt;
              &lt;/form&gt;
              &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt;
                  &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
              &lt;/button&gt;
  
              &lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&gt;
                  &lt;ul class="navbar-nav mr-auto font-weight-bolder toGridNav"&gt;
                      &lt;li class="nav-item"&gt;
                          &lt;a class="nav-link" href="#"&gt;همکاری با ما&lt;/a&gt;
                      &lt;/li&gt;
                      @if (SignInManager.IsSignedIn(User))
                      {
                          &lt;li&gt;
                              &lt;form asp-controller="Account" asp-action="Logout" role="form" method="post"&gt;
                                  &lt;input type="submit" value="Logout" /&gt;
                              &lt;/form&gt;
                          &lt;/li&gt;
                          &lt;li class="nav-item cart"&gt;
                              &lt;img src="images/ca.svg" height="30" alt=""&gt;
                          &lt;/li&gt;
                          &lt;li class="nav-item user"&gt;
                              &lt;img src="images/us.svg" width="30" height="30" alt=""&gt;
                          &lt;/li&gt;
                      }
                      else
                      {
                          &lt;li class="nav-item"&gt;
                              &lt;a asp-controller="Account" asp-action="Login" class="nav-link"&gt;ورود&lt;/a&gt;
                          &lt;/li&gt;
                          &lt;li class="nav-item"&gt;
                              &lt;a asp-controller="Account" asp-action="Register" class="nav-link"&gt;عضویت&lt;/a&gt;
                          &lt;/li&gt;
                      }
  </code></pre>
  
  <p>And here is an image of the browser:</p>
  
  <p><a href="https://i.stack.imgur.com/Ja7EK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ja7EK.png" alt="enter image description here"></a></p>