Windows Server 2003 SP 2

windows

Guest
I just installed this SP and now I have a problem with my Visitors count. Here is what I have in my global.asa page.



Sub Application_OnStart
Application("visitors") = 0
End Sub

Sub Session_OnStart
Application.Lock
Application("visitors") = Application("visitors") + 1
Application.UnLock
End Sub

Sub Session_OnEnd
Application.Lock
Application("visitors")=Application("visitors") - 1
Application.UnLock
End Sub


What is happening is that it is not resetting so that the "Visitors Online Now" simply goes up and up and up. It was working fine before I installed this sp. Any ideas?What problems do you have exactly? Does the count not go up at all and nothing happens or do you get errors? This might be a little better suited for ASP board but dont you need a database to track how many visitors are online? If you do make sure your database is still properly initialized after your update.It probably should be on the asp board. Please move it if possible.

I am not getting any errors. It just doesn't decrease when someone leaves the site. I am tracking max online using a db but it really is just my global.asa that is the problem.

Again, it was working fine until I installed SP 2 on my Win 2003 Server.Ok I am really looking for some help here? Anyone have any ideas, please?

Thanks...In ASP you can not create a "server" object in the session_end event.Is "Session_end" different from "Session_OnEnd"?i meant OnEnd ... sorry its been a while since i have used ASP. I now use .net for everything.I am not sure what you mean, "you can't create a server object in "session_onend." It stopped working immediately when I upgraded the service pack?It should never use Server.CreateObject or CreateObject in ASP in the event Session_OnEnd this should have never worked. It didn't work in IIS5, it shouldn't have worked in 6.

Either way it sounds as there are threading issues terminating the ASP Thread Pool by health monitoring. You should first check the Event logs to see if this is true.As usual, this has been very helpful. I am now keeping track (loosely) of visitors online now with some db programming. If you have time, can I ask how sites like this keep track of who is online at any given time?I would write to the db the session id every page request, using a SQL job remove any with a request time less than the timeout of the session. before i did that though i would copy the max number of visitors at any given time to another table for that range. it would allow you to visually see all the users on a date range.

in .net it is possible to do create objects during the session end event. better threading model and bunch more control over event processing.I HAVE GOT TO migrate to .net.......

Thanks again!
 
Back
Top