I've been trying to get a html/js based Language selection system to work and I need a persistent cookie for it, which saves the choice of Language the user made, for a certain amount of time. Sadly this cookie is mistaken by Firefox for an activity tracking cookie(which it kinda is), and thus is deleted, when the session ends. Can I prevent this from happening somehow?
If this script would work, my finished code should work aswell:
if(document.cookie==""){
document.cookie = "test=Hello World; max-age=3600";
}
else{
window.location.replace("https://www.youtube.com/");
}
What it should do:
- The first time the site is opened, a cookie is set and nothing further happens.
- The second time the user gets redirected to youtube.com.
This Image shows Firefox's blocked scripts for activity tracking over the past week