OpenEdge.Net.HTTP Cookie management - Forum - OpenEdge General - Progress Community

OpenEdge.Net.HTTP Cookie management

 Forum

OpenEdge.Net.HTTP Cookie management

This question is answered

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?

Verified Answer
  • 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.

All Replies
  • 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?

  • If it is to remove the cookie from the remote browser, wouldn’t you just add the cookie with no value?
     
    Dave
     
  • 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!