I'm learning about creating cookies with Javascript and have created this experimental log in page. It works 100% but I want to be able to display the users username and password. Can this be done with cookies in Javascript? I have attached my current code below:
function displayCookies(){
    if (GetCookie("user") || GetCookie("pass")){
        document.regform.usercookie.value = GetCookie("user");
        document.regform.passcookie.value = GetCookie("pass");
    }else{
        document.cregistrationform.usercookie.value = "Make sure you have signed up!";
        document.registrationform.passcookie.value = "Make sure you have signed up!";
    }
}
function createCookies(){
    var username = document.registrationform.user.value;
    var password = document.registrationform.pass.value;
    var date = Date();
    SetCookie("user", user);
    SetCookie("pass", pass);
    alert("You have registered!");
    alert("Welcome back" + username ". Your last visit was" + date);
}
function reloadPage() {
  location.reload(); 
}
</script>
 
    