P
Patrick Olurotimi Ige
I'm tracking usersOnline by adding this code below in my Global.asax
file.But i noticed that when a user logs in it keeps adding a new user
which thats fine..but when a user logs of it still retains the
user(session) for sometime instead of reducing it by one!
I'm thinking of maybe i should change something in IIS relating to
Session?
Any ideas..
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Session("Start") = Now
Application.Lock()
Application("ActiveUsers") = CInt(Application("ActiveUsers")) +
1
Application.UnLock()
End Sub
--------------------------
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
Application.Lock()
Application("ActiveUsers") = CInt(Application("ActiveUsers")) -
1
Application.UnLock()
End Sub
file.But i noticed that when a user logs in it keeps adding a new user
which thats fine..but when a user logs of it still retains the
user(session) for sometime instead of reducing it by one!
I'm thinking of maybe i should change something in IIS relating to
Session?
Any ideas..
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Session("Start") = Now
Application.Lock()
Application("ActiveUsers") = CInt(Application("ActiveUsers")) +
1
Application.UnLock()
End Sub
--------------------------
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
Application.Lock()
Application("ActiveUsers") = CInt(Application("ActiveUsers")) -
1
Application.UnLock()
End Sub