Copied to clipboard

Flag this post as spam?

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


  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 21, 2010 @ 16:17
    Rune Grønkjær
    0

    Session acces in base methods

    It seems that there is no access to Session in HttpContext.Current on my base methods. Anyone know a workaround to get that access? I really need Session in my base methods. Can't really use them if they don't know the current session.

    My version is 4.5.2 and My Request and Respone all works like a charm through HttpContext.Current. There's just no Session.

    Anyone?

    /Rune

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Oct 21, 2010 @ 21:07
    Lee Kelleher
    0

    Hi Rune,

    I'm not 100% sure on this, but it's worth a go... it could be that your /Base class needs to implement one of the SessionState interfaces? (depending on read/write access).

    http://aspadvice.com/blogs/ssmith/archive/2007/07/29/Accessing-Session-from-an-HttpHandler.aspx

    Cheers, Lee.

  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 22, 2010 @ 08:55
    Rune Grønkjær
    0

    Thanks, but looking a little deeper into it (Looking in the umbraco source code) it looks like the base calls is fired in the BeginRequest event. This is bad because Session state has not (and seems to cannot) be set on that early a stage.

    This might mean that I will have to create my own HttpHandler like Karsten did here:
    http://our.umbraco.org/forum/developers/api-questions/7973-MemberGetCurrentMember()-in-base

    I just don't want to do that if there is any other way!?

    /Rune

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 22, 2010 @ 09:02
    Dirk De Grave
    0

    Seems to be resolved in changeset 59555 according to Codeplex, so it should work?

     

    Cheers,

    /Dirk

  • Rune Grønkjær 1372 posts 3103 karma points
    Oct 22, 2010 @ 09:07
    Rune Grønkjær
    0

    That is not at all what I'm experiencing. I have a clean install and that session is just null no matter what I do. Maybe I have to do something myself. The header of the issue is "Listen to PreRequestHandlerExecute to get access to Session state in Base requestModule" Does that mean that they now DO it or the I some how can do it?

    /Rune

  • Chad Rosenthal 272 posts 474 karma points
    Dec 21, 2010 @ 05:21
    Chad Rosenthal
    0

    Did you ever get this resolved? I'm experiencing the same issue.

    -C

  • Rune Grønkjær 1372 posts 3103 karma points
    Dec 21, 2010 @ 08:10
    Rune Grønkjær
    0

    Hi Chad,

    It has been resolved in Umbraco 4.6 latest 1.0.3966.21682.zip

    Get it here: http://nightly.umbraco.org/umbraco%204.6/4.6%20Alpha/

    It will NOT be resolved with a patch for 4.5, but the 4.6 runs fine on my solutions. So use that if you need it.

    /Rune

  • Chad Rosenthal 272 posts 474 karma points
    Dec 21, 2010 @ 14:04
    Chad Rosenthal
    0

    Can you get away with just upgrading the umbraco.dll? Or do you need to just fully install it?

    -C

  • Rune Grønkjær 1372 posts 3103 karma points
    Dec 21, 2010 @ 14:17
    Rune Grønkjær
    0

    Hmm, I installed it. No major breaks back then. Back up your solutions beforehand and you will have no problems going back if something weird should happen.

    You might be able to use just the dll's, but I'm not sure.

    /Rune

  • Chad Rosenthal 272 posts 474 karma points
    Dec 21, 2010 @ 15:39
    Chad Rosenthal
    0

    Tried to just use the umbraco.dll, that didn't really work. It could be because of the dependencies (other projects referencing the dll), or it could be because there are dependencies to other dll's in 4.6.

    -C

     

Please Sign in or register to post replies

Write your reply to:

Draft