I am getting and error message when i'm trying to get Session value in Global.aspx:
I have tried another method to get Session value and result is same but message is different:
This error occur in Application_Error method and Session is not null but it shows that it is null. I have put this Session code in (HttpContext.Current.Session != null) condition so it is working fine but i want session value which is not getting with this method.
Please help me. Thanks
Global.asax file is generally used to track the application level events and those are shareable between the different logged in users so it might not be possible to get the session value in global.asax events.
For error logging you can use the httpModule
Below link for error logging using httpModule
http://www.codeproject.com/Articles/16171/An-HTTP-Module-for-ASP-NET-Error-Handling
Below link is for getting session values in httpModule