Skip to content

Commit

Permalink
Fixed runtime errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mehakraza committed May 30, 2024
1 parent ac9b554 commit 165de35
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions extensions/cmp/cmp_custom_vendor_mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = '; expires=' + date.toUTCString();
}
const domain = '.' + window.location.hostname.split('.').slice(-2).join('.');
document.cookie = `${name}=${value || ''}${expires}; path=/; secure; domain=${domain}`;
document.cookie = name + '=' + (value || '') + expires + '; path=/; secure; domain=.' + window.location.hostname.split('.').reverse().splice(0, 2).reverse().join('.');
deleteCookie(OLD_STORAGE_KEY);
}

function deleteCookie(name) {
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
document.cookie = name + '=; expires=' + new Date(0).toUTCString();
}

async function fetchConsentData() {
Expand Down

0 comments on commit 165de35

Please sign in to comment.