The easiest way would be to add a static counter that would increment on Session_Start and decrement on Session_End. You'll need to add a variable (like Session["IsActive"] = true;) to the session to allow Session_end to fire properly.
If you want to track by-user you will need to add a static IEnumerable (or a class I suppose, if you prefer) that is similarly manipulated by the Session Start and end events, but using either names or your database keys.
public class MvcApplication : HttpApplication
{
public static List<int> UsersOnline{ get; set; }
protected void ApplicationStart()
{
UsersOnline = new List<int>();
}
protected void Session_Start(object sender, EventArgs e)
{
UsersOnline.Add();
}
protected void Session_Start(object sender, EventArgs e)
{
UsersOnline.Remove();
}
...
}
</int></int>