Here is a quick and dirty way to track the number of active users on your site as a given time. This is implemented on SoccerXpert.com.
The implementation is simple just add the following code to the global.asax:
The implementation is simple just add the following code to the global.asax:
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("ActiveSessionCount") = 0
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Application("ActiveSessionCount") += 1
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Application("ActiveSessionCount") -= 1
End Sub
In your master page add a reference to the session variable:
Dim ActiveSessionCount as Integer = Application("ActiveSessionCount")
Links to this post
0
comments