<SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Session_OnStart ' Lock the Application object Application.Lock ' Increment the count Application("VisitorsToday") = Application("VisitorsToday") + 1 ' Unlock the Application object Application.Unlock End Sub </SCRIPT>
There still is no test to roll over your count when it's a new day. You need something like this above where you increment the counter. You'll have to work out what to really use in place of Today and Yesterday :)
If Today = Yesterday Then Application("VisitorsToday") = 0 'reset the counter for a new day End If
Then increment your counter.
Also, in a Sub Application_OnStart() event you should initialize the counter to a numeric value
Sub Application_OnStart() Application("VisitorsToday") = 0 End Sub
Application.lock is a good idea when you're updating an application variable, using lock and unlock prevents concurrency problems with other users.