Fixed Remeber me script
This commit is contained in:
@ -8,4 +8,23 @@ function remeberMe(){
|
|||||||
function forgetMe(){
|
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"
|
||||||
Reference in New Issue
Block a user