请大家帮我提提建议
有一个登陆程序do_login.asp:
<!-- #include file="conn.asp" -->
<!-- #include file="functions.asp" -->
<%
Dim strErrRpt 'as String
Dim rsIdentity
Set rsIdentity = Server.CreateObject("ADODB.Recordset")
Dim strSql 'as String
strSql="SELECT strID,strPwd,dept FROM tbl_members WHERE strID='" & Request("strID") & "'"
rsIdentity.Open strSql,conn,1,1
if rsIdentity.RecordCount>0 then
'check password
if UnencryptString(rsIdentity("strPwd"))=Request("strPwd") then
Session("strDept")=rsIdentity("dept")
response.redirect "search.asp"
else
strErrRpt="密码错误"
Session("strMember")=""
end if
else
strErrRpt="无此会员"
Session("strMember")=""
end if
rsIdentity.Close
Set rsIdentity=Nothing
Dim strUrl
strUrl=Request("wait")
if strUrl="" then strUrl="login.asp"
if Session("strMember")<>"" then
Jump strUrl,"top"
else
MsgBox strErrRpt
Back
end if
%>
如果用户名和密码都对,则打开search.asp。在search.asp中,我现在是用Session("strDept")来控制用户不能直接打开search.asp,即
<%
'判断身份
'如果未登录
Dim str_dept
If IsNull(Session("strDept")) Or Session("strDept")="" Then
response.redirect "login.asp"
else
str_dept = Session("strDept")
end if
%>
但是我现在不想用Session,大家有没有什么好的建议,来控制用户不能直接打开search.asp呢?