在ASP.NET C#中自动注销 [英] Auto logout in asp.net c#

查看:93
本文介绍了在ASP.NET C#中自动注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个asp.net网站.我需要在应用程序中自动注销功能.如果用户在站点上处于活动状态15分钟,则它将自动注销并更新login_status-0中的数据库.我正在使用代码,如果用户登录,则数据库登录状态为1.因此,如果用户在15分钟内未处于活动状态或突然关闭浏览器,则需要更新login_status = 1数据库.

请任何人都可以帮助我...谢谢

I am developing a asp.net website. I need to auto logout function in my application. If user is not active in the site for 15 minutes then it automatically log out and update database in login_status-0. I am using the code, if user is login then in the database login status=1. So, i need to update database login_status=1 if user is not active for 15 minutes or suddenly close the browser.

Please any one can help me......Thanks

推荐答案

您可以将会话超时设置为15分钟.浏览器不会关闭-只会过期.
看看状态管理- http://msdn.microsoft.com/en-us/library/ms972429 .aspx [^ ] .
You can set the session timeout to 15 minutes. The browser will not close - it will simply expire.
Have a look at state management - http://msdn.microsoft.com/en-us/library/ms972429.aspx[^].


您需要将会话超时设置为15分钟.是的,只终止会话,不会关闭屏幕.
You need to set your session timeout to 15Minutes. And yes, expire only the session, it will not close the screen.


^ ]


这篇关于在ASP.NET C#中自动注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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