I am talking about this piece of code
function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1) end = dc.length;
}
return decodeURI(dc.substring(begin + prefix.length, end));
}
if(getCookie('cookie_notice_accepted') === 'true') {
My document.cookie is "cookie_notice_accepted=true; DO-LB=node-196037985|XvH1v|Xv"
. the DO-LB cookie is a load balancer cookie which is set using the Set-Cookie
HTTP header on each request, on Chrome it is at the end of the string.
However, when getCookie('cookie_notice_accepted')
is called, it returns "true; DO-LB=node-196037985|XvH1v|Xv"
when in reality it should return just "true"
.
Please fix this soon, we have a production website with this issue.