I am able to get the current date, but I don’t know how to get the current date + 1 day (in GMT)
var now = new Date();
var newexp = (now + 3);
var show = newexp.getGMTString();
alert(show);
What I’m really trying to do is set a cookie to expire in 1 day.
function SetCookie(name, value, exp) {
var now = new Date();
var newexp = (now + exp); // exp being # of days before expiration
document.cookie= name + "=" + value+ "; expires=" + newexp.getGMTString() + ";"
}
SetCookie('name', 'john', '3');
Obviously, this is not working.
edited it to take the exp as the factor, it is the no. of days.