function setMoney(value) {
var myDate = new Date(2050, 9, 12);
myDate.toUTCString();
alert(document.cookie); //i get the old cookie as normal
document.cookie = "money=" + value + ";expires=" + myDate + ";";
alert(document.cookie); //i get money=987996 and i dont get the expiration date
}
setMoney(987996);
这里有什么问题?这就像代码只是停在 + 值 + 位。更改方法调用行中的数字仍然会导致警报中的数字更改,所以我知道它正在设置一些东西。