aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/scripts/cookie.js
diff options
context:
space:
mode:
authorPhy <git@phy25.com>2019-03-13 18:27:33 -0400
committerPhy <git@phy25.com>2019-03-13 18:27:33 -0400
commitfe36a27b514198b045f9b92daa1c0252bd4680c3 (patch)
tree42772ed860405a91f57a7962d9a0f60d8614ee87 /lib/scripts/cookie.js
parentbded2f50427c1a29306e13bec420fd7804b75718 (diff)
downloaddokuwiki-fe36a27b514198b045f9b92daa1c0252bd4680c3.tar.gz
dokuwiki-fe36a27b514198b045f9b92daa1c0252bd4680c3.zip
cookie.js when setValue‘s value parameter is false delete entry
Diffstat (limited to 'lib/scripts/cookie.js')
-rw-r--r--lib/scripts/cookie.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/scripts/cookie.js b/lib/scripts/cookie.js
index 4fb9c25f7..e260e5919 100644
--- a/lib/scripts/cookie.js
+++ b/lib/scripts/cookie.js
@@ -22,8 +22,13 @@ var DokuCookie = {
var text = [],
_this = this;
this.init();
- val = val + "";
- this.data[key] = val;
+ if (val === false){
+ delete this.data[key];
+ }else{
+ val = val + "";
+ this.data[key] = val;
+ }
+
//save the whole data array
jQuery.each(_this.data, function (key, val) {
@@ -42,7 +47,7 @@ var DokuCookie = {
*/
getValue: function(key, def){
this.init();
- return key in this.data ? this.data[key] : def;
+ return this.data.hasOwnProperty(key) ? this.data[key] : def;
},
/**