Ken H

Ken H

  • NA
  • 646
  • 354.6k

How to get Session values in Global.asax?

Apr 23 2014 11:59 AM
Hi,
   How to get Session values in Global.asax? 
 
My codes:
protected void Application_AuthenticateRequest(object sender, EventArgs e){
try
{
if (HttpContext.Current.Session["UserID"]!=null){  // Program error occurs here.
   // TO DO STH...
}
}
catch { } // Not logged in does not make.
}
 
Note: I need to do this: whenever the user touches a page to know the login ID.
 
 
Thanks. 

Answers (2)