I want to access session in handler for that i am inheriting “IRequireSessionState” Class. but while evaluating the session it is coming null, but on the web page it has value. i dont know why this is happening my code of handler is:
public void ProcessRequest(HttpContext context)
{
String Name = Common.GetSessionValue("UserId").ToString() ;
// my code.........
Here is my common method to Get Session’s value
public static Guid GetSessionValue(string SessionName)
{
Guid returnvalue = Guid.Empty;
if (HttpContext.Current.Session[SessionName] != null)
{
returnvalue = new Guid(HttpContext.Current.Session[SessionName].ToString());
}
else
{
HttpContext.Current.Response.Redirect("Login.aspx");
}
return returnvalue;
}
Please help me. Thanks in advance
You can try this by Exposing the value to the outside world http://forums.asp.net/t/1506625.aspx/1 and then trying to fetch the value in handler using
You can see the exposed value in firebug AddOn in Mozilla