Re: Users online
There is one thing, you don't want to do it like this:
while (reader.Read())new SiteUser(settings, Convert.ToInt32(reader["UserID"])));
because when you use that constructor for each user you are hitting the db again when you already have all the users data in the reader, this will exhaust the connection pool and cause performance problems.
it needs to be more like:
SiteUser siteUser = new SiteUser();
siteUser.UserID = (int) reader["UserID"];
siteUser.Name = reader["Name"].ToString();
... populate the rest of the properties you need
as for the accuracy, yeah its just a judgement call, it can never be truly accurate in a stateless environment without really going against the grain. i'd probably go with 20-30 minutes.
You probably will want to add some code in Default.aspx.cs at the end of page load like this.
SiteUser siteUser = SiteUtils.GetCurrentUser();
so the activity gets updated on every page view