Cannot Delete _fbp Cookie

Viewed 1225

I have a button to give users the option to accept cookies, and another for them to revoke the cookies.

I am using the Cookie Notice for GDPR plugin by dFactory and Google Analytics Dashboard Plugin for WordPress by MonsterInsights. I am using Facebook Pixel via a Google Tag Manager script on my website.

When the revoke button is clicked I revoke the cookies and reload the page. All my cookies delete successfully, but when I try to revoke the _fbp cookie it persists.

Name: _fbp
Value: fb.1.1562101432060.130183292
Domain: .upperroombooks.com
Path: / 
Expires/Max-Age: 2019-09-30T21:03:52.000Z
Size: 32
HTTP:
Secure:
SameSite:

I am using the following code to attempt to delete the cookie:

document.cookie = '_fbp' + '=; Path=/; Domain=.upperroom.org; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';

(Again, this method works for the other cookies.)

Funny enough, when I enter this code in the dev tools console it deletes the cookie as expected.

1 Answers

The domain of the _fbp cookie is:

Domain: .upperroombooks.com

When you're deleting the cookie, the domain you're trying to use is:

Domain= .upperroom.org

There may be an invalid domain warning in your console alluding to this.

If you correctly set (or remove) the Domain, it should work without issue.

I don't expect this will help the OP over 2 years on but it might help someone.

Related