I am having a problem deleting a cookie on my test server. On my dev machine the cookie deletes fine.
This is the request/response taken from fiddler. I’m trying to delete the .Hv2 cookie
I’ve tried without setting the path part of the response cookie – no difference. This is a grab of how the cookie looks from FF.
One difference I’ve noticed between my dev machine and the test server is that the host for the cookie on my dev machine is .my.hostname.dev instead of .hostname.dev
Here is the code I use to remove the cookie
var oldFormsCookie = context.Request.Cookies['.Hv2']; if (oldFormsCookie != null) { context.Response.Cookies.Remove(oldFormsCookie.Name); var removalCookie = new HttpCookie(oldFormsCookie.Name) { Expires = DateTime.Now.AddYears(-1), Domain = oldFormsCookie.Domain, Value = 'remove' }; context.Response.SetCookie(removalCookie); }
It looks to me like it ought to be deleting this cookie! Anyone got any ideas?? thanks

Well it looks like the issue was that the domain for the cookie was appearing as null, when it was in fact the same as the FormsAuth cookie. I changed the code to
and it seemed to work