本文介绍了在模块中记录会话结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当用户通过关闭浏览器而不是使用模块实际注销结束浏览会话时,我想写到数据库.

我知道我可以使用global.asax Session_End事件来实现这一目标.但是,我想通过模块执行此操作.

使用

Hi,

I am wanting to write away to the db, when a user ends his browsing session by closing the browser instead of actually logging out using a module.

I know i could use the global.asax Session_End event to achieve this. I want however to do this via a module.

Using the

Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init

       AddHandler context.AcquireRequestState, AddressOf app_AcquireRequestState

   End Sub


   Public Sub app_AcquireRequestState(ByVal o As Object, ByVal ea As EventArgs)

       Dim httpApp As HttpApplication = CType(o, HttpApplication)
       Dim ctx As HttpContext = HttpContext.Current
       ctx.Response.Write(" Executing AcquireRequestState ")

   End Sub

事件处理程序,我可以检查该会话是否处于活动状态或已终止,然后将其作为过期/关闭的浏览器注销将其写出吗?

我还有什么其他事情可以通过模块来实现吗?

任何帮助将不胜感激.
谢谢.

event handler, will i be able check whether the session is active or killed and then write it away as a expired/closed browser logout?

Is there any other event i could up to in the pipeline to achieve this via a module?

Any help would be appreciated.
Thanks.

推荐答案


这篇关于在模块中记录会话结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 17:39
查看更多