完美解决PJ的Cookies保存时限问题!可选择记录登陆(4)
ReInfo(0)="错误信息"
ReInfo(1)="<b>用户名与密码错误</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
logout(false)
else
memLogin("mem_LastIP")=getIP()
memLogin("mem_lastVisit")=now()
memLogin("mem_hashKey")=HashKey
Response.Cookies(CookieName)("memName")=memLogin("mem_Name")
Response.Cookies(CookieName)("memHashKey")=HashKey
if Cint(Request.Form("KeepLogin"))<>0 then Response.Cookies(CookieName).Expires=Date+Cint(Request.Form("KeepLogin"))
memLogin.Update
ReInfo(0)="登陆成功"
ReInfo(1)="<b>"&memLogin("mem_Name")&"</b>,欢迎你的再次光临。<br/><a href=""default.asp"">点击返回主页</a><meta http-equiv=""refresh"" content=""3;url=default.asp""/>"
ReInfo(2)="MessageIcon"
ReInfo(3)=true
end if
end if
memLogin.Close
Set memLogin=Nothing
login=ReInfo
end function
然后搜索
[Copy to clipboard]CODE:
memLogin("mem_LastIP")=getIP()
有三处!将其删除...
再搜索
[Copy to clipboard]CODE:
if CheckCookie("mem_LastIP")<>Guest_IP or isNull(CheckCookie("mem_LastIP")) then
logout(true)
else
memName=CheckStr(Request.Cookies(CookieName)("memName"))
memStatus=CheckCookie("mem_Status")
end if
替换为
[Copy to clipboard]CODE:
memName=CheckStr(Request.Cookies(CookieName)("memName"))
memStatus=CheckCookie("mem_Status")
2.修改login.asp:
将以下代码替换<form name="checkUser" action="login.asp" method="post">至</form>断
[Copy to clipboard]CODE:
<form name="checkUser" action="login.asp" method="post">
<div id="MsgContent">
<div id="MsgHead">用户登录</div>
<div id="MsgBody">
<input name="action" type="hidden" value="login"/>
内容版权声明:除非注明,否则皆为本站原创文章。