1
I have the following code:
function createCookie(name,value) {
name = "testeeee";
value = "conteudo do teseeee";
var date = new Date();
date.setTime(date.getTime()+(720*60*60*1000));
var expires = "; expires="+date.toLocaleString();
alert(date.toLocaleString());
alert(name+"="+value+expires+"; path=/");
document.cookie = name+"="+value+expires+"; path=/";
}
But in the browser appears like this:
I try every way to set the end date of it to expire, but only in that in the browser.
Do you want the cookie to stay until how long? By my calculation you want 12h or I’m wrong?
– Maury Developer