Counting no. of visitors online

seema.nare@oasis-bs.com

Active member
Joined
May 19, 2006
Messages
27
Programming Experience
Beginner
Asp.net 2.0 :
I have developed a page that displays the count of no. of visitors online. It works fine in the local network server but when I uploaded it on Live server, it shows me the incremented count for every visited page instead of the session start.
My code in global.asax is like this:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
Application("client_count") = 0
End Sub


Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
Application("client_count") = Application("client_count") + 1
End Sub

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Application("client_count") = Application("client_count") - 1

End Sub

What is the error ?

Thanks.
 
Back
Top