By default when you create a cookie in ASP.NET Core it is only applicable to that specific subdomain.
For example, a cookie created in subdomain.mydomain.com can not be shared with a second subdomain secondsubdomain.mydomain.com.
To change this behavior, you need to add the following code in Startup.ConfigureServices
:
By specifying a common domain in the Cookie.Domain property, the cookie will be shared between subdomain.mydomain.com
and secondsubdomain.mydomain.com.