We're running a WordPress site with WooCommerce. A third party plugin was injecting (sbjs_*
) cookies into our site to track purchases and provide us with additional reporting. Unfortunately, something's gone wrong with the plugin and all web requests with sbjs
cookies set result in a 403.
To fix this issue I've disabled the plugin, however, the sbjs
cookies have an expiry of 6 months, which means all visitors who've visited us before, have cached the cookies, and get the 403 error.
How do I remove the bad cookies from all requests, but leave the cookies needed for WooCommerce and our payment gateways, etc.
I've tried
.htaccess
:RewriteCond %{HTTP_COOKIE} sbjs_migrations|sbjs_current_add|sbjs_first_add|sbjs_first|sbjs_current|sbjs_udata RequestHeader unset Cookie
However, this of course kills all cookies, which I don't really want to do as it breaks other functionality.
How do I expire those cookies, so that anyone visiting the site who has the cookies, will have them erased before their expiry date? (ie something in the page header?)