I am trying to create a cookie.
I Run asp net core on host port: 44332
and the the front-end reactjs on port 3000
my Cors service:
services.AddCors(options =>
{
options.AddPolicy(name: "ReactChat",
builder =>
{
builder.AllowAnyMethod()
.WithOrigins("http://localhost:3000")
.AllowAnyHeader()
.AllowCredentials();
});
});
I have tried a couple of things
string newGuid = Guid.NewGuid().ToString();
HttpContext.Response.Cookies.Append("Login", newGuid, new CookieOptions
{
SameSite = SameSiteMode.None,
Domain = "http://localhost:3000/"
}); ;
and in the configureservices:
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Domain = "http://localhost:3000";
options.Cookie.Name = ".AspNet.SharedCookie";
options.Cookie.Path = "/";
});