title: How can I share session among subdomains in ASP.NET Core?
body: <p>I have a website which has subdomains such as ali.sarahah.com but if a user logs in from <em>www.sarahah.com</em> then goes to <em>ali.sarahah.com</em> the session is not saved. After searching I added the following in <code>Startup.cs</code>:</p>
  
  <pre><code>app.UseCookieAuthentication(new CookieAuthenticationOptions
  {
      CookieDomain = ".sarahah.com"
  });
  </code></pre>
  
  <p>I found out that .AspNetCore.Identity.Application cookie domain is still showing the subdomain and not the the domain and that session problem is still there.</p>
  
  <p>Am I doing something wrong?</p>