避免并发登录(注销前登录会话)在ASP.net成员资格 [英] Avoid concurrent login (logout former login session) in ASP.net membership

查看:118
本文介绍了避免并发登录(注销前登录会话)在ASP.net成员资格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习的ASP.net会员功能。

I am learning the ASP.net membership feature.

我想知道我怎么能实现如此注销前的登录会话,后来登录会话避免并发登录。我知道如何检查用户是否在线(通过Membership.IsOnline()),并注销当前用户(由FormsAuthentication.SignOut())。但我不知道该怎么注销previous登录会话。

I am wondering how I can implement so that later login session logout former login session to avoid concurrent login. I know how to check whether the user is online (by Membership.IsOnline()) and logout the current user (by FormsAuthentication.SignOut()). But I don't know how to logout the previous login session.

任意code或引用,我可以读?

Any code or reference that I can read?

推荐答案

我不认为有一个明确的方式来做到这一点。

I don't think there is an explicit way to do this.

要实现这将是存储在令牌缓存某种日志(会话ID?),当用户登录。每次吊销旧令牌用户登录,然后添加一个HttpModule哪些检查方法之一令牌......当收到请求时不匹配,注销用户。此外,把一个母版页这样的逻辑或页面对象从所有的应用页面继承。

One way to implement it would be to store some sort of log in token (session ID?) in the Cache when a user logs in. Revoke the old token each time that user logs in. Then add an HttpModule which checks this token... when a request comes in that does not match, log the user out. Alternatively, put this logic in a master page, or a page object from which all your app pages inherit.

这篇关于避免并发登录(注销前登录会话)在ASP.net成员资格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆