Consider user leaves the site in two ways:
1. As soon as server finishes with every response.
2. Clicks logout button.
Since not all of them will choose 2, you should create a mechanism to
control a list of logged in users with a timeout for the records. For
example (if you use a DB table for users, not Windows accounts), you could
create a column in the table for the last login date and time, update it
every login and create a view with the criteria to compare last login date
and time with the current date and time minus 5-10 minutes (you decide).
For the Windows accounts, almost the same if you could create a table
somewhere, even as the virtual table without an actual DB and keep that
table as the application variable, ar saved as XML file.
"Bar??" <ae*******@yaho o.com> wrote in message
news:e3******** *************** ***@posting.goo gle.com...
Hi,
I want to show number of active users (login users) on my web page.
Creating the number of activate users is easy. I increased an
application variable (Application("n umOfUsers")) by one when a user is
logged in. But a problem comes up when decreasing this application
variable. I made this decramention in session_end but for a long time
there is no change on the value of application variable. I think this
problem is caused by session life property... How can provide the
application variable to decrease immediately when a user leaves the
site?