London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

EPiServer 6 page version compare function exception

Vote:
 

Hi, everyone.

I'm experiencing problem while trying to compare publish page versions in EPiServer CMS 6.

Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.

 

Exception is thrown on line that tries to access Session.

I've installed an empty cms 6 website using EPiServer Deployment manager and the same situation. Call like following <%=this.Session["someSessionKey"]%> - throws exception as above.

It proves that exception occures not because my project configuration.

 

After some "reflectoring" episerver code found following:

EPiServer.UI.Edit.PageCompare.Core.PageComparerProviderBase, EPiServer.UI, Version=6.0.530.0

method: private static string GetHtmlByDummyRequest(string pageUrl)

{
    string str;
    DummyWorkerRequest dummyRequest = GetDummyRequest(pageUrl);
    HttpContext current = HttpContext.Current;
    try
    {
        HttpContext.Current = new HttpContext(dummyRequest);
        HttpContext.Current.User = current.User;
        IHttpHandler handler = (IHttpHandler) BuildManager.CreateInstanceFromVirtualPath(dummyRequest.GetFilePath(), typeof(Page));
        HttpContext.Current.Handler = handler;
        typeof(HttpContext).InvokeMember("_ProfileDelayLoad", BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Instance, null, HttpContext.Current, new object[] { true });

HttpContext.Current.Handler.ProcessRequest(HttpContext.Current);
HttpContext.Current.Response.Flush(); str = dummyRequest.OutputWriter.ToString(); } finally { HttpContext.Current = current; } return str; }

During that kind of call Context is not fully initialized and exception happens.


Does anyone know how to handle this situation?

Thanks in advance,
Artem.
    

#43734
Sep 22, 2010 14:42
Vote:
 

Call to the page is made as HttpContext.Current.Handler.ProcessRequest(HttpContext.Current); So it is not a full page get reguest.

#43736
Sep 22, 2010 14:51
Vote:
 

Looks like the Bug#54423 Compare page versions crashes when page uses session object

#43737
Sep 22, 2010 14:58
Vote:
 

Hi I am having the same issue. Do you know if there is any update to this? or perhaps you can point me towards where I could find out?

Thank you

 

#46909
Jan 10, 2011 19:39
Vote:
 

This is odd, I can't seem to find the bug in the bug list. It is discussed in this thread too: http://world.episerver.com/Templates/Forum/Pages/Thread.aspx?id=43961&epslanguage=en

I think I got the bug ID from the response to my original bug report.

Perhaps someone at EPiServer can check what happened to the bug?

#46918
Jan 11, 2011 6:58
Vote:
 

Hi!

I checked the bug and it was closed as a duplicate of bug #41873 which should be fixed in the CMS 6 R2 beta release.

Regards
Linus Ekström
EPiServer Development Team

#46919
Jan 11, 2011 8:12
Vote:
 

Is there a hotfix for this bug for CMS 6 as we are not in a position to upgrade to R2 at this time?

#57476
Mar 15, 2012 15:42
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.