Advanced Users Online
Many people have tutorials out there that allow you to count the number of active users online with the use of the global ASA file; however, they do not show you the user's location and "what they are doing".
i.e, going to your users_online.asp page may show the following:
- user J.Buttafucco is viewing the guestbook (/dev/guestbook.asp)
- user A.Fischer is deleting a guestbook entry (/dev/guestbook_delete.asp)
- user T.Harding is beating people up (/dev/beat_peeps_up.asp)
![](/Downloads/Tutorial_online_users_3.zip/gr.gif)
![](/Downloads/Tutorial_online_users_3.zip/gr.gif)
![](/Downloads/Tutorial_online_users_3.zip/gr.gif)
![](/Downloads/Tutorial_online_users_3.zip/bc.gif)
Wrap up
So from start to finish, let's see how this script works:
1. User visits your page.
A session is started, which spawns the SESSION_ONSTART of your Global.ASA file.
If their SessionID is not in the database, then it is added and they are then
UPDATE by the second procedure so that that record now contains their SessionID,
Name or Session("person"), Location, or Request.ServerVariables("SCRIPT_NAME")
and What they are doing, or Session("doing").
2. Everytime the user goes
to a page, their Session ID is used to find them in the table and their LOCATION
and DOING status are changed depending on the value of that page.
3. When the USER LEAVES
their session open inactivly for the TIMEOUT period , then the user's status
is update to LOGGING OUT and then their SessionID is used to find themselves
in the database, and they are removed. Then their Session is abandoned.
And that's that. I did this
script from scratch. I asked for help but got none, so never be too discouraged
to go find out how to get bizniss done! If you got any questions, I welcome
comments or suggestions! Thanks and enjoy!
Oh yeah! I like bagels and
Snapple Peach Iced Tea!
BTW, this has been tested
and created on a Windows XP Pro (boo! hiss! boo!) system running IIS5.1 and
SQL Server 7.
![](/Downloads/Tutorial_online_users_3.zip/gr.gif)
![](/Downloads/Tutorial_online_users_3.zip/gr.gif)
![](/Downloads/Tutorial_online_users_3.zip/gr.gif)
![](/Downloads/Tutorial_online_users_3.zip/bc.gif)
Comments
Great
Great tutorial. Just one thing would have make things lot easier for the newbies. I can imagine that volks will have some problems in implementing the script so why not provide them the files and the database. Then things will be lot more easier to understand.
Anyways thanxalot finally i got it workin, was lookin for this for a long time.
RE: Great
Great??
I don't even know why its rated 4.7?? It doesnot work. There are many errors. I am working on it if somebody sorted out then please let me know.
You must me logged in to write a comment.