I am trying to store the password and username inside a cookie and when the user logs in again to the page it should show the username and password here is the cookie function, it should store the cookie for 15 days and then it expires
here is the code
<input type="text" id=user ><br>
<label for="key" id=passlbl>password:</label><br>
<input type="password" id="pd">
here is the javascript
let username = document.getElementById("user");
let pwd = document.getElementById("pd");
createCookie(username.value,pwd.value)
function createCookie(name,pwds){
today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + 3600000*24*15);
document.cookie = name.value+"="+encodeURI(pwds.value)+";path=/" + ";expires="+expire.toUTCString();}
but when I refresh the page the text inside the input fields disappear