网络编程
位置:首页>> 网络编程>> Asp编程>> ASP不允许同一个用户同时登陆两次

ASP不允许同一个用户同时登陆两次

  发布时间:2008-06-03 13:45:00 

标签:登陆,验证,session

登陆页login.asp:

<%
if request.Form.count>0 then 
session("username")=request("username")
application(session("username"))=session.SessionID
response.Redirect("index.asp")
end if
%>
<form method=post action="">
<input type="text" name="username"><input type="submit">
</form>

其他需要认证的页面index.asp:

<%
if application(session("username"))=session.SessionID then
response.Write("已经登陆")
else
response.Write("没有登陆")
end if
%>
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com