Skip to content

Commit

Permalink
Fix cookie remove function (#111)
Browse files Browse the repository at this point in the history
* add: pass domain to cookie remove function

* 2.5.2
  • Loading branch information
soumen-saniel authored Aug 27, 2021
1 parent bd0dd65 commit 891c2ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions lib/cookie/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ function readCookie (name) {
*
* @param {String} name The cookie name.
*/
function removeCookie (name) {
function removeCookie (name, domain) {
delete store[name];
createCookie(name, '', -1);
if (domain) {
createCookie(name, null, -1, domain);
}
else {
createCookie(name, '', -1);
}
}

module.exports = {
Expand All @@ -80,7 +85,7 @@ module.exports = {
});

cookieConsent.subscribe(name, 'disable', function () {
removeCookie(name);
removeCookie(name, domain);
});
},
read: readCookie,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bv-ui-core",
"version": "2.5.1",
"version": "2.5.2",
"license": "Apache 2.0",
"description": "Bazaarvoice UI-related JavaScript",
"repository": {
Expand Down

0 comments on commit 891c2ab

Please sign in to comment.