<%'以下代码为保存用户名和密码于cookies中function ok()'定义函数,登录成功后,'调用该函数将用户名和密码写入本地COOKIES中select case request.form("tima")'判断语句'根据用户选择保存时间,设置本地COOKIES的过期时间caes 1Response.Cookies("name").Expires=Date+1'设定COOKIES的过期时间'当Date+1时保存一天,Date+365时即保存一年,依此类推;若删除此句'则浏览器关闭后COOKIES失效Response.Cookies("name")=request.form("name")'创建一个名为"name"的本地COOKIES,并把用户名写入其中Response.Cookies("pwd").Expires=Date+1'保存一日response.Cookies("pwd").request.form("pwd")case 2Response.Cookies("name").Expires=Date+31'保存半年Response.Cookies("name")=request.form("name")Response.Cookies("pwd").Expires=Date+31response.Cookies("pwd")=request.form("pwd")case 3Response.Cookies("name").Expires=Date+182'保存半年Response.Cookies("name")=request.form("name")Response.Cookies("pwd").Expires=Date+182response.Cookies("pwd")=request.form("pwd")case 4Response.Cookies("name").Expires=Date+365'保存一年Response.Cookies("name")=request.form("name")Response.Cookies("pwd").Expires=Date+365response.Cookies("pwd")=request.form("pwd")end selectend function'定义函数结束%>
添加回答
举报
0/150
提交
取消