Allow user to select tarteaucitron cookie domain (for multi-site)
This commit is contained in:
parent
a7b5fb7e36
commit
a5f0900963
|
|
@ -865,14 +865,15 @@ var tarteaucitron = {
|
||||||
expireTime = time + 31536000000, // 365 days
|
expireTime = time + 31536000000, // 365 days
|
||||||
regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
|
regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
|
||||||
cookie = tarteaucitron.cookie.read().replace(regex, ""),
|
cookie = tarteaucitron.cookie.read().replace(regex, ""),
|
||||||
value = 'tarteaucitron=' + cookie + '!' + key + '=' + status;
|
value = 'tarteaucitron=' + cookie + '!' + key + '=' + status,
|
||||||
|
domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : '';
|
||||||
|
|
||||||
if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
|
if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
|
||||||
tarteaucitron.pro('!' + key + '=' + status);
|
tarteaucitron.pro('!' + key + '=' + status);
|
||||||
}
|
}
|
||||||
|
|
||||||
d.setTime(expireTime);
|
d.setTime(expireTime);
|
||||||
document.cookie = value + '; expires=' + d.toGMTString() + '; path=/;';
|
document.cookie = value + '; expires=' + d.toGMTString() + '; path=/;' + domain;
|
||||||
},
|
},
|
||||||
"read": function () {
|
"read": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue