When I clicked allow the cookie at the blog page, then it have their own path. When I back to the index page it ask for cookie again.
(But if I click allow at the index page, it will link to every page.) [enter image description here][1]
This happens when I clicked allow at the index page and blog page. (It's have 2 cookies and the same name but different path) [1]: https://i.stack.imgur.com/mjlI4.png
acceptBtn = cookieBox.querySelector(".consent_buttons button");
acceptBtn.onclick = ()=>{
document.cookie = "Geek-Cookies=GEEKGENTH; max-age"+60*60*24*30;
if(document.cookie) { //if the above cookie had set
cookieBox.classList.add("hide");
}else {
alert("Cookie can't be set!");
}
}
let checkCookie = document.cookie.indexOf("Geek-Cookies=GEEKGENTH");
checkCookie != -1 ? cookieBox.classList.add("hide"): cookieBox.classList.remove("hide");```
Thank you,