session variables are available in all pages
there is two functions declared in global.asax file that wire up when needed
Code:
void Session_OnStart(...)
{
// when session starts. code goes here ... eg
int counter = int.Parse(Session["onlineUsers"].ToString());
counter++;
Session["onlineUsers"] = counter;
}
void Session_OnEnd(...)
{
// when a session ends
int counter = int.Parse(Session["onlineUsers"].ToString());
counter--;
Session["onlineUsers"] = counter;
}