求教高手:cookie 的时效设置问题
此段为文章表情投票的源码:(原来是退出浏览器重新进入又能投票的,我想改为3天后(设置cookie的生存期),才可以投票。如下改后,连投票表情都不显示了,不知何故,请高手指教,万分感激。(红色部分为修改部分)function get_mood(mood_id)
{
var cookname=
var liveDate = new Date();
liveDate.setTime(liveDate.getTime() + 3*24*60*60*1000);
//if(moodzt == "1")
if (get_cookie('laoymood<%=request("ID")%>')=='<%=request("ID")%>')
{
alert("你已经投过票了!");
}
else {
url = "http://"+window.location.host+"<%=SitePath%>xinqing.asp?action=mood&id="+infoid+"&typee="+mood_id+"&m=" + Math.random();
makeRequest(url,'return_review1','GET','');
//moodzt = "1";
//document.cookie='laoymood'+infoid+'='+infoid+'';
cookname='laoymood'+infoid+'='+infoid+'';
document.cookie="name=cookname;expires=" + liveDate.toGMTString();
}
}