I'm building a web application using ASP.NET Core and need to share authentication cookies between two separate domains (e.g., example.com and example.net). Despite configuring CORS and setting SameSite=None, the cookies are not shared across domains.
any one can you help me?
Deepika SawantPosted Jul 17, 2025, 3:28 PM
Browsers do not allow cookies to be shared across different top-level domains (e.g.,
example.comandexample.net) due to security restrictions. Cookies can only be shared across subdomains (e.g.,app.example.comandapi.example.com) by setting the cookie domain to.example.com.consider alternative approaches like:
If you're working with
example.comandexample.net, consider using JWT tokens:Authorization: Bearer) to the other domain.This approach is stateless, secure, and works across domains.
https://learn.microsoft.com/en-us/aspnet/core/security/cookie-sharing?view=aspnetcore-9.0