function setCookie() {
if (allowCookie) {
let cookieData = "";
//
//
cookieData = cookieData.substring(0, cookieData.length - 1);
let today = new Date();
today.setTime(today.getTime() + 30 * 24 * 60 * 60 * 1000);
cookieData =
"input=" + cookieData + "; expires=" + today.toUTCString() + "; path=/";
document.cookie = cookieData;
console.log(cookieData);
console.log(document.cookie);
}
}
Wenn ich den Code jetzt ausführe bekomme ich in der Console folgende ausgabe:
input=A.13.9.A.12.11.10.8..A.14.11.13.12.12.A.11.13.A.10.10.A.14.11.13.12..A.12.11.11.12..A.14.14.13.A.12.13.A.15.12.13.A...A.15.15.A.15.10.A...14.12.13; expires=Thu, 23 May 2024 09:06:19 GMT; path=/
""
wenn ich navigator.cookieEnabled auslese ist dies true. Also warum wird mein Cookie nicht abgespeichert?