I am a newbie at this and I need some help. I have created a form that stores the values that a user inputs through a cookie. Everytime I go to another page and then return to the form, the values that the user has input are there like they're supposed to be. But, when I shut off the browser and restart it and go back to that form, the values do not reappear.
How do I set the cookie so that it doesn't expire when the browser is shut off? See code:
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+"="
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
document.cookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "" +
( (path) ? ";path=" + path : "" +
( (domain) ? ";domain=" + domain : "" +
( (secure) ? ";secure" : ""
}
Any help is appreciated [sig][/sig]
How do I set the cookie so that it doesn't expire when the browser is shut off? See code:
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+"="
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
document.cookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "" +
( (path) ? ";path=" + path : "" +
( (domain) ? ";domain=" + domain : "" +
( (secure) ? ";secure" : ""
}
Any help is appreciated [sig][/sig]