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

问题描述

您好,

我想在会话结束时更新用户状态。

任何人都可以帮我这个吗?

这里是我的代码块



Hello,
I would like to update user status on session end.
Can any one please help me on this?
Here is my code block

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
       Try
           Dim clsbss As New cls_business
           Dim clsAccountIndicator As New cls_usermanagement
           '    Dim clsAccountIndicator As New cls_usermanagement
           If Session("UserName") Is Nothing And clsbss.bssIsLogin Then
               Session.Abandon()
               clsbss.bssAddActionLog("Session_End", clsbss.bssCookiesGetUserSID, "User (" & clsbss.bssCookiesGetUserName & ") has logged out at " & Format(Now, "dd MMM yyyy hh:mm tt"), Now, Now, clsbss.bssCookiesGetUserName, clsbss.bssCookiesGetUserSID, Now)
               clsAccountIndicator.Update_Account_Indicator_Status(clsbss.bssCookiesGetUserSID, 2)
               Thread.Sleep(500)
               clsbss.bssLogout()
               'Response.Redirect(System.Configuration.ConfigurationSettings.AppSettings("hosturl") & "index.aspx")
           End If

       Catch ex As Exception
           'Response.Redirect(System.Configuration.ConfigurationSettings.AppSettings("hosturl") & "index.aspx")
       End Try
   End Sub





也在配置中



Also in config

<sessionstate mode="InProc" timeout="5" />

推荐答案


这篇关于会话结束不会被触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-30 00:16