How to remove a cookie in Apache

后端 未结 4 597
广开言路
广开言路 2020-12-30 03:55

I need to remove a cookie from the HTTP request that gets to the server. Doing it on the client (that writes this cookie) or on the server (that reads it) is not an option.

4条回答
  •  执念已碎
    2020-12-30 04:56

    Apache mod_rewrite allows manipulation of URLs but not of HTTP headers, however 'mod_headers' will let you do that.

    So, you could use:

    RequestHeader unset Cookie
    

    This will strip all cookies from the request. I'm not sure if its possible to remove just a particular cookie using this technique.

    Alternatively, you can stop cookies being passed back to the client using:

    Header unset Set-Cookie
    

    if that's more appropriate.

提交回复
热议问题