我想问下ASP只允许同时登录一个用户怎么实现
青岛星网下面给出Asp Session实现禁止同时登录的例子,实现此功能需要在登录页和所有需要验证登录的地方添加如下代码:
<% 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>
<% if application(session("username"))=session.SessionID then response.Write("您已经登陆了!") else response.Write("您未登陆!") end if %>
青岛星网说下,需要认证的所有网页就是指首页、后台管理、用户中心等。也就是你需要通过Session读取用户登录信息的地方。