How to send cookies from account.domain.com to app.domain.com?
I am working on an authentication. I want to send cookies from account.domain.com to app.domain.com. The problem is, I can send cookies in the response header but the browser does not set the cookie. I can see in the network tab, cookies present in the response header.
I want to use these cookies across all sub-domains i.e *.domain.com
cookie sent from account.domain.com
var cookie = new HttpCookie("key", "value");
cookie.Domain = "domain.com";
cookie.HttpOnly = true;
cookie.Secure = true;
cookie.SameSite = System.Web.SameSiteMode.None;
cookie.Path = "/";
System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
return Ok();
on the client side, I use javascript(Axios) to send them.
await axios("https://app.domain.com/endpoint", {withCredentials: true});
await axios("https://api.domain.com/endpoint", {withCredentials: true});
I want to send these cookies with every request so I can authenticate.