Added Remeber and Forget me

This commit is contained in:
2025-10-18 01:14:23 -05:00
parent a4d34f29d2
commit 52e5c6bd3d

View File

@ -7,12 +7,31 @@ rock.src = "/media/Art/Rock1.png";
ctx.fill()
document.cookie = "username=TechRunner"
function remeberMe(){
let input = document.getElementById("username");
let username = input.value;
document.cookie = "username=" + username;
console.log(username);
cookieStore.getAll().then(data => {
console.log(data);
})
}
function forgetMe(){
document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"
console.log("Poof!...");
}
cookieStore.getAll().then(data => {
if (data){
for(let i = 0; i < data.length; i++){
console.log(data[i]["value"]);
if (data[i]["name"] == "username"){
let username = data[i]["value"];
document.getElementById("intotitle").textContent = "Welcome back " + username + " to the Void System";
}
}
}
console.log(document.cookie);
})