ASP程序中同一个用户不允许同时登陆两次
登陆页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
%>
这个程序最后一点没写好。
大致意思就是限制同一个帐户在不同的位置同时登陆。
实现的方法就是将已经登陆的帐户的id保留在application中,但是程序没有解决意外退出的问题,如果需要实现这个目标,请参考程序思路自行研究。
最好的办法是使用global.asa
同一个用户不允许同时登陆两次
原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]
相关文章:
- asp重定向-response.redirect和server.transfer(2007-10-24 9:18:30)
- vbscript Replace 函数(2007-10-21 4:33:2)
- vbscript:日期格式常数(2007-10-10 7:30:49)
- For...Next 语句(2007-10-4 9:43:2)
- Chr 函数(2007-10-2 9:21:42)
- vbscript InputBox 函数(2007-9-24 8:25:19)
- CCur 函数(2007-9-20 6:10:44)
- vbscript:字符串常数(2007-9-19 1:12:22)
- While...Wend 语句(2007-9-12 4:58:27)
- vbscript Join函数文档与实例(2007-8-27 4:52:50)
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
