Skip to content

Commit

Permalink
Delete legacy wp-gds-cmp cookie that might be stuck on .kinsta.cloud …
Browse files Browse the repository at this point in the history
…domain
  • Loading branch information
oxyc committed Jun 18, 2024
1 parent 768941d commit c2e5501
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions assets/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ window.gdsCmp = {
...(window.gdsCmp || {}),
};

// Delete legacy wp-gds-cmp cookie
if (/gds-consent=[01],[01],[01],[01]/.test(document.cookie)) {
const host = document.location.host.split('.').slice(-2).join('.');
document.cookie = `gds-consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=.${host}; path=/`;
}

ready(() => {
// Initialize the cookie consent banenr and expose window.gdsCmp object.
const cookieConsentContainer = document.querySelector('.cookie-consent');
Expand Down
2 changes: 1 addition & 1 deletion dist/main.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '96a3b7ff28886352f73a713dd642a985');
<?php return array('dependencies' => array(), 'version' => 'ef254b5b6f2a3a6a856ad784b5c76cb6');
2 changes: 1 addition & 1 deletion dist/main.js

Large diffs are not rendered by default.

0 comments on commit c2e5501

Please sign in to comment.