I am currently working on a project where we add cookies to an IHttpResponse in a WebHandler.
That works nicely using the IHttpResponse.SetCookie method.
The problem now is that I want to remove the cookie I set, but in another request
Is this possible?
We finally managed to delete the cookie from the front end, the incorrect domain was used when trying to remove it.
I also believe you can do this, not by adding the cookie with no value, as David Cleary suggested, but by adding it as expired.
Are you keeping the response object around?
There is a RemoveCookie() method on the HttpResponse object that you can use to remove cookies. Or am I misunderstanding?
We finally managed to delete the cookie from the front end, the incorrect domain was used when trying to remove it.
I also believe you can do this, not by adding the cookie with no value, as David Cleary suggested, but by adding it as expired.
The problem is that I want to remove it in a subsequent request, not the current one, after it has been set in the remote browser. I tried the RemoveCookie method, but I think that only affects the HttpResponse's cookie container.
I haven't tried that but I believe that if you set it as expired it should work.
Thanks for the tip!