SaaS CMS has officially launched! Learn more now.

Session cache is being ignored when travelling between pages more than once



I really hope someone can help with this as I have a day and a half to find a solution.

I have two aspx pages, one of which is a templated page in the CMS, the other just an aspx page in the file system.

Page 1 creates some data and adds it to the session.  Page two takes the data back out of the session and displays it.  The problem is that when you go back a page, change some data on page 1, then resubmit, page 2 ignores the new information.

Am I missing something really obvious?  I'll ensure that page 2 is also a templated page in the CMS in case this in any way is causing the problem.  The weird thing is, when I first created the pages I had the same problem, but it went away for a week on its own, and only came back yesterday.

In a basic webapp in VS2010, I created the same page1 to page 2 logic, and it worked as I expected.  The EPiServer page type seems to break it.


In desperation,



Jan 20, 2011 8:10

Guess you experience the page cache. Add the session key to the cache parameter in site and problem is solved. When you are logged in the page cache is not used

Jan 20, 2011 8:35

Thanks for your quick reply Anders.  Could you be a bit more specific please?  

I'm new to using cache functionality so not entirely sure what this entails.


Many thanks.

Jan 20, 2011 8:59

Check if it works when you are logged on

If it does, then the page is cached, and you get the result from the cached page.

Then you need to add the session key in httpCacheVaryByParams

<episerver xmlns="http://EPiServer.Configuration.EPiServerSection">


<site description="Example Site" siteId="">

<siteSettings httpCacheVaryByParams="id,epslanguage"

Jan 20, 2011 9:04

Hi Anders,

Those parameters are already in the config.

I've added:


to my second page and now everything works as planned.


Thanks very much for your feedback,


Jan 20, 2011 10:08
* 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.