Answered by:
Unable to Get Session value in HTTPHandler File

Question
-
User1575626668 posted
Dear All,
In project i am using HttpHandler File, In That File I want to Access Session Value. but i am getting error-Object Refrence Set to null.
i have made this change also
using System.Web.SessionState;
public class Upload : IHttpHandler, IRequiresSessionState
{ }sessions are only working in ie and in other browser it is not working.
Please Help me to solve this problem
Monday, July 18, 2011 6:54 AM
Answers
-
User1698673233 posted
sachindotnetdevel
Read this links
https://github.com/Glimpse/Glimpse/issues/87
http://codebetter.com/raymondlewallen/2005/06/23/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-3-common-causes-in-vb-net/
http://stackoverflow.com/questions/5123024/how-to-handle-null-in-session-variable-of-type-int
thanks
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 21, 2011 3:41 PM
All replies
-
User-1161841047 posted
Try to implement IReadOnlySessionState instead of IRequiresSessionState.
public bool IsReusable { get { return true; } }
public void ProcessRequest(HttpContext ctx)
{
ctx.Response.Write(ctx.Session["YourSessionID"]);
}Monday, July 18, 2011 7:34 AM -
User1575626668 posted
Thank you for reply
I have already implemented both the conditions but it is only working in internet explorer.
in Other Browser i am getting error of Object refererence ........ null value
Thanks
Tuesday, July 19, 2011 5:13 AM -
User1698673233 posted
sachindotnetdevel
Read this links
https://github.com/Glimpse/Glimpse/issues/87
http://codebetter.com/raymondlewallen/2005/06/23/system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-3-common-causes-in-vb-net/
http://stackoverflow.com/questions/5123024/how-to-handle-null-in-session-variable-of-type-int
thanks
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 21, 2011 3:41 PM