var cookie = {
put: function(name, value, expire) {
var expires = "";
if (expire) {
var date = new Date();
date.setTime(date.getTime() + (expire * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
}
document.cookie = name +"="+ value + expires + "; path=/";
},
get: function(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var j=0; j < ca.length; j++) {
var c = ca[j];
while (c.charAt(0) == ' ')
c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length,c.length);
}
return null;
},
delete: function(name) {
this.put(name, '', -1);
}
};
Comments
Comments are not available for this entry.