From link :
You cannot directly delete the cookie on the user's computer. However, you can direct the user's browser to delete cookies by setting the cookie expiration date to a past date. The next time the user makes a request for a page in the domain or path that sets the cookie, the browser determines that the cookie has expired and deleted it.
So, how to remove / delete cookies in ASP.NET Web Api at the action filter level, try setting the cookie expiration date to the last date:
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { var response = actionExecutedContext.Response; var request = actionExecutedContext.Request; var currentCookie = request.Headers.GetCookies("yourCookieName").FirstOrDefault(); if (currentCookie != null) { var cookie = new CookieHeaderValue("yourCookieName", "") { Expires = DateTimeOffset.Now.AddDays(-1), Domain = currentCookie.Domain, Path = currentCookie.Path }; response.Headers.AddCookies(new[] { cookie }); } base.OnActionExecuted(actionExecutedContext); }
source share