×

ASP 中 Cookies 的 Expires 属性的设置(JS版本)

lixiaoyao lixiaoyao 发表于2016-09-17 14:47:19 浏览2348 评论0

抢沙发发表评论

 

直接上代码,代码中有注释

复制代码
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<% myDate = + 365);  mon =  Array("January","February","March","April","May","June","July","August","September","October","November","December" exps = mon[myDate.getMonth()] + " " + myDate.getDate() + "," +"numvisits").Expires == Request.Cookies("numvisits"(!
    Response.Cookies("numvisits") = 1"<h1>欢迎,这是您第一次访问该页面</h1>"++"<h1>这是您第 " + numVisits + " 次访问</h1>""numvisits") =%>
复制代码

JavaScript 脚本编写 Cookies 的 Expires 属性时尽量设置为日期字符格式:

January 9,2017

访客