This is an ASP.NET MVC application. The cookies are not getting created in Firefox. There is no such issue in Chrome or Edge.
HttpCookie myCookie = new HttpCookie("myCookie")
{
Value = "some_value",
Expires = DateTime.Now.AddYears(1)
};
HttpContext.Current?.Response.Cookies.Add(myCookie);
- I have tested this in a fresh installation of Firefox 123.0 64-bit.
- The site is not a local site and it has
https. - I have turned off the
Enhanced Tracking Protectionand also added the domain of my website inSettings > Privacy > Cookies - Manage Exceptions.
UPDATE:
I see this error in browser console for the Ajax POST call - NS_BINDING_ABORTED.
This is the JS Method:
function redirectTo(obj, url) {
xhr('/api/MyController/SetCookie', JSON.stringify(obj), () => {
});
window.location.href = url;
}
From what I understood here, Firefox does this with any page redirection code and if there is another process running already.
So, I have added a delay and it works fine now.