Copied to clipboard

Flag this post as spam?

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


  • Christoffer Andersen 23 posts 53 karma points
    Feb 18, 2010 @ 12:39
    Christoffer Andersen
    0

    session problem in static base class

    Greetings

     

    I have made use of the /base methods in umbraco and got it all working. However if I want to make use of a Session element where I have refered to HttpContext.Current.Session["MyRequestedSession"], whenever I try to read a value it crashes. I have offcourse tested if there are any info in the session, which there however I suspect that the error lies in /base being url accessed and it therefor might not know anything about sessions.

     

    So my question is simply put if anyone got a session element to work in there /base in a static content, and if they could then post an example of how it works.

     

    With kind regards

    Christoffer

  • Christoffer Andersen 23 posts 53 karma points
    Feb 18, 2010 @ 12:46
    Christoffer Andersen
    0

    Oh yeah forgot basic info.

    Using umbraco 4.0.3

    IIS 7

    and the error I was presented with upon trying to access my session is foloowing:

    <error>
    MESSAGE:
    Exception has been thrown by the target of an invocation.

    STACKTRACE:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras)

    INNEREXCEPTION:
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Designit.Umb.Newsletter.Custom.EmbedNewsletter.Embstep4(String templateAlias) in C:\Projects\Designit.Umb.Newsletter\Designit.Umb.Newsletter.Custom\EmbedNewsletter.cs:line 108
    </error>

  • Ron Brouwer 273 posts 768 karma points
    Feb 18, 2010 @ 14:32
    Ron Brouwer
    1

    Hi Christoffer,

    Have you tried adding the following to your web.config?

    <modules runAllManagedModulesForAllRequests="true">

    Ron

  • Christoffer Andersen 23 posts 53 karma points
    Feb 18, 2010 @ 14:55
    Christoffer Andersen
    0

    That approach might work, however I don't have access to the web.config file, but atm I have solved it temporarely with addind a temporarely database that stores my sessions value

  • Martin Lingstuyl 202 posts 379 karma points
    Dec 21, 2010 @ 16:35
    Martin Lingstuyl
    0

    By the way. This conversation was some time ago, but the approach of runallmanagedmodules does not work.

    Does anyone know what does?

  • aghy 129 posts 308 karma points
    Dec 21, 2010 @ 16:59
    aghy
    0

    Hi Martin,

    Take a look at this I had the problem of not being able to access the session from /base when using umbraco 4.0.3. After a bit of searching I found a fix.

    I have since started using 4.5.2 and its much better especially the new way of doing xslt.

    Ben

Please Sign in or register to post replies

Write your reply to:

Draft