Here is a very simple example.
First, the global.asa
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
'This is a very simplistic example.
' Ths initializes the counter
Application("ONLINE_COUNT") = 0
' Use whatever timeout you want. This sets it to 1 minutes for test purposes
' so you can easily see the count go down as sessions are ended...
Session.Timeout = 1
' By setting a session variable when we first start a session we make sure that
' a session is actually started.
Session("STARTED") = Now
' Increment that counter that keeps track of users with an active session
Application("ONLINE_COUNT") = Application("ONLINE_COUNT") + 1
' Decrease the active visitors count when the session ends.
Application("ONLINE_COUNT") = Application("ONLINE_COUNT") - 1
and now a simple page to demonstrate:
' I named this page ShowCount.asp
s = "The count is: " & Application("ONLINE_COUNT") & "<br/>"
GetCount = s
GetSessionStart = "I signed on at: " & Session("STARTED") & "<br/>"
<head><title>Count Users Test</title></head>
I found an example of what you want here:
Woody Z http://www.learntoprogramnow.com