Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Acoustic 4 posts 24 karma points
    Aug 20, 2009 @ 16:32
    Acoustic
    0

    MissingSession State for Base Methods

    I just got done adding a few REST-like Base methods to my web site and came across a bit of an issue with how the incoming requests are handled.  I'm calling the base methods via a jQuery ajax GET request.  When I do that, the HttpContext.Current.Session state object is null.  Is this behavior a limitation of how Base works? That is, is Session simply not available via Base methods?  If it is available, what do I need to do to get access to a non-null session?

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 21, 2009 @ 15:25
    Ismail Mayat
    0

    Acoustic,

    This is a case also in webservices however you can turn on state in webservice using attribute WebMethod(EnableSession:=True)  see http://msdn.microsoft.com/en-us/library/aa480509.aspx you may be able to do something similar in base?

    Regards

    Ismail

  • Kenneth Solberg 227 posts 418 karma points
    Sep 06, 2009 @ 23:16
    Kenneth Solberg
    0

    I believe it's because Base requests are handeled in the BeginRequest event and at this stage the Session object will still be null as it hasn't been initialized by the ASP.NET runtime yet. We should probably move the handling code to an event that occurs after PostAcquireRequestState. In the meantime you could write a custom handler that overrides the default one and update web.config with your own.

  • Kenneth Solberg 227 posts 418 karma points
    Oct 14, 2009 @ 10:07
    Kenneth Solberg
    0

    FYI. fixed in v4.1

Please Sign in or register to post replies

Write your reply to:

Draft