由于会话超时,如何更新数据库中的注销时间? [英] How Do I Update Logout Time In Database Due To Session Timeout ?

查看:74
本文介绍了由于会话超时,如何更新数据库中的注销时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更新会话超时导致的数据库注销时间?以及如何使用global.asax中的session_end方法

How do i update logout time in database due to session timeout ? and how to do that using session_end method in global.asax

推荐答案

即使在global.asax文件(或global.asax)中也为会话结束添加代码存根.cs文件)并且只是正常编码



https://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionstatemodule.end.aspx [ ^ ]



请注意,此事件非常不可靠,不适用于进程外会话(即存储在SQL或State Server中的会话),也不能与客户端进行交互。在会话结束事件中的任何方式,你不能做重定向,你没有响应或请求等。
Add a code stub for the session end even in your global.asax file (or the global.asax.cs file) and just code in it as normal

https://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionstatemodule.end.aspx[^]

Note that this event is very unreliable and won't work for out of process sessions (ie those stored in SQL or State Server), and also not you can't interact with the client in any way in the session end event, you can't do redirects, you don't have a response or a request etc.


这篇关于由于会话超时,如何更新数据库中的注销时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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