I converted a website that was done in ASP to dotnet, and brought over a
number of items, some of which don't appear to work in the same way on
dotnet as they did on ASP.
One of them is an application variable.
I have this code in my global.asax in the Sub Session_Start:
Application.Lock() 'Add 1 to active visitor count when new visitor
Application("counter99") = Application("counter99") + 1
Application.UnLock()
It's a counter that I increment each time a user logged in to my old ASP
site.
I have this in the Sub Session_OnEnd to decrement the same counter:
Sub Session_OnEnd(ByVal sender As Object, ByVal e As EventArgs)
Application.Lock() 'Sub 1 active visitor count when new visitor
Application("counter99") = Application("counter99") - 1
Application.UnLock()
End Sub
I know that in ASP, you couldn't really rely on the session end to get a
"good" accurate count on users, but in ASP, it generally worked, and
gave you a reasonable estimate of how many users were hitting the site
at a time.
In dotnet, this counter registers a number exponentially higher than
what it did in ASP.
Is there a way I can implement a counter for current users of the
website that would be a tad more accurate than this?
Any help appreciated.
Thanks
BC