同一用户只能登录一次,直到在asp.net中注销。 [英] same user can only login once till logout in asp.net.

查看:87
本文介绍了同一用户只能登录一次,直到在asp.net中注销。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我有问题,一个用户可以登录一次直到退出。其他人不能使用相同的用户名登录。



我在数据库LoginStatus上有一个ststus,默认值是'F',登录时它变为'T'。并且在登录时我正在检查他可以登录的F状态。在会话输出和退出时间我已更新到状态为'F'。这是我已经完成的程序。



我的问题是,当用户直接关闭浏览器时,状态不会更新,用户无法登录再次。





上述细节还有其他流程吗?或者我会改变什么。





谢谢.....

Hello

I have a problem , one user can login once till logout. other cann't login on the same username.

I have a ststus on database LoginStatus and default value is 'F', when login it change to 'T'. and at the time of login i am checking which status if 'F' he can login. On session out and Logout time i have updated to the status to 'F'. This is the procedure which i have done.

My problem is that when that user will close the browser directly then the status is not updating and that user can't login again.


Is there any other process for the above details. or what i will change.


Thanks.....

推荐答案

你可以使用Page Unload Event来做到这一点。

查看此链接以获取更多参考。



通过单击[X]按钮检测浏览器关闭[ ^ ]





http://stackoverflow.com/questions/2117870/page-unload-event-in-asp-net [ ^ ]



http://aspalliance.com/ 1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide.all [ ^ ]
You can do that using Page Unload Event.
Check this links for more reference.

Detect browser closing through clicks on the [X] button[^]


http://stackoverflow.com/questions/2117870/page-unload-event-in-asp-net[^]

http://aspalliance.com/1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide.all[^]

不,没有:您的会话到期应该将登录标志更改回未登录 - 如果该代码正常工作,您说它会这样做,那么您的用户应该只需要等到会话到期,通常为20分钟。



没有可靠的方法来绝对检测浏览器关闭(特别是在所有浏览器上都没有相同的方法) - 如果电源出现故障会怎样?或者他失去了移动信号?还是无线上网?您必须确保您的会话到期代码正常工作,因为这是告诉用户登录应该过期的唯一可靠方式。
No, there isn't: your session expiry should change the "logged in" flag back to "not logged in" - you say it does so if that code is working then your user should just have to wait until the session expires, normally 20 minutes.

There is no reliable way to absolutely detect browser close (particularly there is no way that works the same on all browsers) - and what happens if the power fails? Or he loses mobile signal? Or Wifi? You have to ensure that your session expiry code is working, as this is the only reliable way to tell is the user login should be expired.


这篇关于同一用户只能登录一次,直到在asp.net中注销。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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