Fixed Remeber me script

This commit is contained in:
2025-10-29 17:27:30 -05:00
parent 9b1a8b4426
commit 4e6209678a

View File

@ -9,3 +9,22 @@ function forgetMe(){
document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/" document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"
console.log("Poof!..."); console.log("Poof!...");
} }
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
let decodedCookie = getCookie("username") + " ";
document.getElementById("introtitle").textContent = "Welcome " + decodedCookie + "to the Void System"