This is my script.
<script>
function save() {
var x=document.getElementById("user").value;
var y=document.getElementById("password").value;
document.cookie=x+" "+y;
}
function write() {
document.write(document.cookie);
}
</script>
This works fine, it remembers the value of var x and y and writes them when function write() is called. When I close the browser the cookie gets deleted, as it should. But I would like to set an expire date of one year; I tried in many ways but I really can't get it to work. Any help?