I am using Web api with AngularJS as front end, I developed an app in local environment and everything works fine locally. But today I had to host my app on a server, and I suddenly can't remove a cookie which I could do locally:
public virtual HttpResponseMessage UnAuthenticate()
{
if (HttpContext.Current.Request.Cookies["sessionId"] != null)
{
HttpCookie cookie = HttpContext.Current.Request.Cookies["sessionId"];
cookie.Expires = DateTime.Now.AddDays(-1);
HttpContext.Current.Response.Cookies.Add(cookie);
}
HttpRuntime.Cache.Remove("cacheToken");
return null;
}
What am I doing wrong?
UPDATE
It works in IE, but it fails in Chrome.