一聚教程网:一个值得你收藏的教程网站

热门教程

asp cookies实例教程

时间:2022-07-02 22:34:13 编辑:袖梨 来源:一聚教程网

想利用COOKIE记录当前用户刚才是否发了贴,
MyVar=Request.Cookies("starttime")
if  myvar="" then

Response.Cookies("starttime")=time()
Response.COOKIES("starttime").Expires=DateAdd("n",1,now())
else
response.Write("您提交的信息频率过快请过15分钟后提交下一条")
response.end
end if
为什么这样不起作用,哪句错了

MyVar=Request.Cookies("starttime")
if  myvar="" then'如果 为空则证明该用户没有来到过该页面

Response.Cookies("starttime")=time()'这时session("starttime")不为空
Response.COOKIES("starttime").Expires=DateAdd("n",1,now())'设置COOKIE保留时间为一分钟
else
response.Write("您一分钟前来过这里,请过一会再来")
response.end
end if

热门栏目