Session state is nothing when using custom FileStorage

Last post 11-29-2007, 5:48 PM by andymacj. 4 replies.
Sort Posts: Previous Next
  •  11-28-2007, 3:52 PM 35495

    Session state is nothing when using custom FileStorage

    Hi,
      We're right at the final stage of integrating cuteeditor into our CMS. The CMS works by setting the session variable "regid" to the customers relevant registration id. This occurs as part of their secure login process. This works happily throughout the site.
     
    In the news editor the user can create an instance of the Cute Editor for editing rich HTML pages and this part works. However, when they go to browse images - specifically to upload an image when the "main" part of CuteEditor creates an instance of our custom class (SQLFileStorage.vb - converted from the demo SQLFileStorage.cs) we find that when we try and reference the session;
     
    Public Sub New(ByVal context As HttpContext)
    MyBase.New(context)
    llngRegID = context.Session(
    "regid")
     
    We get an error because the session object of the context is blank. All the other objects of the context object seem correct(application etc) but the session appears to have been trashed.
     
    I've tried adding a break point on the "session on start" in case your cute code (is it doing the creation in AJAX style and creating a new session?) is creating a new session rather than staying in the existing context but it doens't create a new session so I'm presuming not.
     
    Is there a reason why this session state isn't maintained when using a custom provider ? Is it possible to pass in any other parameters to the customer provider - if so we'd just pass in our own at this point, but I guess that'd involve hacking the CuteEditor code, which we'd like to avoid if at all possible to reduce maintenance on updates.
     
    Thanks in advance,
     
    Andy
     
  •  11-29-2007, 12:05 PM 35523 in reply to 35495

    Re: Session state is nothing when using custom FileStorage

    Andy:
     
    Please try to modify the CuteSoft_Client/CuteEditor/Load.ashx
     
    and change all content to :

     
    <%@ WebHandler language="C#" class="MyLoadHandler" %>
    public class MyLoadHandler : CuteEditor.LoadHandler , System.Web.SessionState.IRequiresSessionState
    {
    }
     
    Hope this helps.
     
    Regards , Terry .
  •  11-29-2007, 5:00 PM 35535 in reply to 35523

    Re: Session state is nothing when using custom FileStorage

    Thanks for the quick response. Looks like it's done the trick.
     
    cheers
    Andy
  •  11-29-2007, 5:16 PM 35538 in reply to 35535

    Re: Session state is nothing when using custom FileStorage

    I sort of spoke too soon !
    What now happens is that within the CMS, it all works fine, the gallery works, image uploads and then displays, embedded in the HTML. However, when I go to the live site, the URL of the image is hard-coded to the path of where the CMS's version of the "downfile.aspx" file.
     
    So, how can I tell the component to not go and get it from there but to get it from the actual site that it's on. Otherwise there's the potential for cross-site scripting type issues with permissions etc.
     
    I don't mind sticking the downfile.aspx file in the root of the public site. I realise that the code is referenced in the HTML that's saved so I *could* parse it to search for downfile.aspx etc. but I'd rather be able to set it neatly in code somewhere.
     
    cheers
    Andy
     
     
  •  11-29-2007, 5:48 PM 35539 in reply to 35538

    Re: Session state is nothing when using custom FileStorage

    Solved. I don't mind having a /cute folder off the site root on any site so I've set that on both the CMS and the main site and set that as the resolve for the DownFile setting and job done.
     
    cheers
    Andy
View as RSS news feed in XML