Copied to clipboard

Flag this post as spam?

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


  • Richard 38 posts 78 karma points
    Feb 23, 2010 @ 23:05
    Richard
    0

    xslt macro=> C# dll: HttpContext.Current.Session invalid?

    Hi,

    I've successfully extended an xslt macro to call a C# dll and am calling this macro from my Home page templates. Everything works fine, except I can't seem to find the session state. I need to store values accross page loads and Session["xxx"] is always turning up to be "not set to an instance of an object". I am using domains/hostnames with <useDomainPrefixes>true</useDomainPrefixes> in umbracoSettings.config in case that makes a difference.

    Any tips on how to store cross-page data in this context.

    Thanks!

    R

     

  • Kenneth Solberg 227 posts 418 karma points
    Feb 23, 2010 @ 23:21
    Kenneth Solberg
    101

    You probably need to implement IRequiresSessionState in your XSLT extension library:

    public class SomeXsltExtensionClass : IRequiresSessionState { ... }
  • Richard 38 posts 78 karma points
    Feb 24, 2010 @ 10:38
    Richard
    0

    Thanks Kenneth,

    This helped and is definitely an answer. I am still plagued by the fact that the session state seems to be a bit flaky: somtimes, is still get null objects. This may be a timing problem, or a problem concerning the Umbraco domain usage, but I'm not enough of an insider to tell... I'll let you know if I figure it out.

    Best regards,

    R

  • Richard 38 posts 78 karma points
    Feb 24, 2010 @ 10:44
    Richard
    0

    When are sessions restarted in Umbraco?

    Thanks!

     

Please Sign in or register to post replies

Write your reply to:

Draft