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.

Jignesh TrivediPosted Apr 24, 2014, 12:10 AM
Hi,
I think you cannot access the session in Application_AuthenticateRequest event because session is not available at this time.
so i think PostAuthenticateRequest event can help you to log the user info.
http://msdn.microsoft.com/en-us/library/system.web.httpapplication.postauthenticaterequest.aspx
hope this will help you.
Ken HPosted Apr 24, 2014, 11:38 AM