I have a function app that sets a cookie when reached:
[FunctionName("SendCookie")]
public async Task<HttpResponseMessage> SendCookie([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post","head", Route = null)] HttpRequest req, ILogger log)
{
var resp = new HttpResponseMessage();
var cookie = new CookieHeaderValue("cookieKey", "cookieValue");
cookie.Expires = DateTimeOffset.Now.AddDays(1);
cookie.Domain = "https://azurefunctionapp.azurewebsites.net";
cookie.Path = "/";
resp.Headers.AddCookies(new CookieHeaderValue[] {cookie});
return resp;
}
I can see in Fiddler the cookie is sent along with ARRAfinity. But I don't see it on firefox's browser storage:
Can someone share some guidance as to what i'm missing please?
thank you for your help
For this problem, you just need to remove cookie.Domain = "https://azurefunctionapp.azurewebsites.net";
.
I test it in my side with the same code with yours'(but without cookie.Domain
)
And the result show as below:
Or you can also set the domain as cookie.Domain = "azurefunctionapp.azurewebsites.net";
(just remove the https://
), it will also work fine.