This commit is contained in:
Victor Lasserre 2024-01-04 17:11:06 +01:00
parent 5e34987209
commit 2540212723

View file

@ -1,10 +1,16 @@
function getCookie(name) {
nom = name + "=";
let liste = document.cookie.split (';');
for (let i = 0; i < liste.length; i++) {
let c = liste[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nom) == 0) return c.substring(nom.length, c.length);
let lookingFor = name + "=";
let arr = document.cookie.split(";");
for(let str of arr)
{
while(str[0] == ' ') // removing potential unwanted spaces
{
str = str.slice(1);
}
if (str.slice(0,lookingFor.length)==lookingFor)
{
return str.slice(lookingFor.length);
}
}
return null;
}