设定cookies时间无效,浏览器关闭无效,手动清除缓存无效,求解
我郁闷了,怎么弄用户的cookies还在,除非代码设定用户的cookies为空,求解啊,设定cookies时间无效,浏览器关闭无效,手动清除缓存无效,求解代码如下:
<!--#include file="conn.asp"-->
<!--#include file="func.asp"-->
<!--#include file="sql.asp"-->
<%dim admin,password
admin=FormatSQL(replace(trim(request.form("admin")),"'",""))
password=md5(FormatSQL(replace(trim(request.Form("password")),"'","")))
passcode=request.form("passcode")
if passcode="" then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!请输入您的验证码!');window.location.href='admin_login.asp';</script>"
response.end
end if
passcode=Cint(request.form("passcode"))
if passcode<>Session("GetCode") then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码错误!');window.location.href='admin_login.asp';</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from [admin] where admin='"&admin&"' and password='"&password&"' "
'response.write sql
rs.open sql ,conn,1,1
if rs.bof and rs.eof then
response.write "<script LANGUAGE='javascript'>alert('你的用户名或者密码错误,登录失败!');window.location.href='admin_login.asp';</script>"
else
if password=rs("password") and admin=rs("admin") then
response.Cookies("huiboshop")("admin")=trim(rs("admin"))
response.Cookies("huiboshop")("rank")=int(rs("rank"))
response.Cookies("huiboshop").Expires=now+1/1440
rs.Close
set rs=nothing
conn.Close
set conn=nothing
response.Redirect "index.asp"
else
response.write "<script LANGUAGE='javascript'>alert('你的密码错误,登录失败!');window.location.href='admin_login.asp';</script>"
end if
end if
%>