Who's Online Application
page 1 of 7
Published: 23 Sep 2003
Unedited - Community Contributed
Abstract
Article explaing a sample application that keeps track of every user that is online on a website. Source code available in C# and VB.Net.
by Alex Campbell
Feedback
Average Rating: 
Views (Total / Last 10 Days): 56980/ 118

Introduction

Introduction

I get a couple of emails a day asking how to make a page that shows which users are online at a particular web site.  This article is more in response to those emails than to a genuine engineering need to solve this problem (in fact, here are a bunch of reasons why this is a bad idea).

If you are just looking to download the code and get it running, click here to be taken to the source download page.


View Entire Article

User Comments

Title: Session.SessionID.ToString());   
Name: Spyros
Date: 10/26/2011 3:19:28 PM
Comment:
Seems not to work on asp.net 3.5 .
In global asa Session.SessionID.ToString()); is null.
Any idea ?
Title: Download links are broken   
Name: Linu
Date: 12/21/2009 1:33:33 AM
Comment:
The download link is broken, please fix it!
Title: I think it is possible to overcome the database hit issue   
Name: Yasser
Date: 11/16/2009 12:56:51 PM
Comment:
You're right, there is no point in doing a trip to the database on every request. As information about active users is useless once their session expires, I think it is a silly idea to store this information in the database (unless some kind of user online history needs to be stored). One alternative is to keep all logged in users in memory and do an in-memory lookup rather than a database lookup. The cleanup tasks are also performed on the online users collection object in memory.
Title: Bad idea ?!!! are you kidding me   
Name: Vex
Date: 11/9/2008 3:51:31 PM
Comment:
When is the last time you checked out myspace.com and facebook.com . People want to know which ones of their friends are online and they want to chat to them. that's one of the main interactive features of any social network website.
Title: Why this could be useful   
Name: Sharky
Date: 1/19/2008 11:31:05 PM
Comment:
one use is to see who is online to engage in an online chat. I think MySpace does this. There is a built in ASP.Net 2.0 function that shows you the number of users online but no built in query to show you who they are.
Title: Code names mixed   
Name: Frank
Date: 9/17/2007 8:16:37 AM
Comment:
Just an FYI. The links for the zip files are backwards. CS is under VB and vice versa.

Great info tho, just what my customer wants. Same as David Allen said, small site (100 users tops) and the admin's want to be able to see who's logging in as well as who's sharing their logins.

I had no idea how this would be done and you've knocked off a lot of time figuring it out on my own.

Thanks,
Frank
Title: Why this is a good idea   
Name: David Allen
Date: 8/2/2005 10:43:21 PM
Comment:
Your concerns about performance impact are legitimate; I share them.
But in enterprise applications (not high-volume, public applications), where users are known and from a limited pool of users, and you support them, then this can be very handy.
Respectfully,
davidkallen at yahoo dot com (email munged to prevent spam)






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2014 ASPAlliance.com  |  Page Processed at 11/29/2014 3:30:10 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search