Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...EnableSessionState is set to true error in all DNN pagesEnableSessionState is set to true error in all DNN pages
Previous
 
Next
New Post
4/26/2015 6:54 AM
 

I have just downloaded my live website, database and integrate it in my local environment. I can only see Home Page but not able to see other pages. I’m facing below error in my all other pages.

I think default.aspx is the home page in DNN so it is working fine but not other pages which are render dynamically from DNN tables.

Error Exception:

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>\<httpModule> section in the application configuration.

Event Log Table Message:

DotNetNuke.Services.Exceptions.PageLoadException: 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 &lt;configuration&gt;\&lt;system.web&gt;\&lt;httpModules&gt; section in the application configuration. ---&gt; 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 &lt;configuration&gt;\&lt;system.web&gt;\&lt;httpModules&gt; section in the application configuration.
      at System.Web.UI.Page.get_Session()
      at DotNetNuke.Framework.CachePageStatePersister.Save()
      at System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state)
      at System.Web.UI.Page.SaveAllState()
      at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
      --- End of inner exception stack trace ---


- Keval
 
New Post
4/26/2015 4:49 PM
 

the error indicates that you need to enable sessions - however I found that strange as I thought there was no DNN code that referenced sessions (due to webfarm issues) -however I checked the code based on your error and found that we do in fact use sessions in that class

https://github.com/dnnsoftware/Dnn.Pl...

The reason why it typically doesn't show up is that we don't store any data in session, only use it to generate a uniqueid -personally I would have done it some other way, but perhaps there is a reason why it was done like this, but it's hard to say as it doesn't appear that the code has changed in years.

It appears that if you change the page state persistence this will resolve it (http://www.dnnsoftware.com/Content/Dn...) , or else enable set enableSessionState to true in your web.config


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
4/27/2015 8:16 AM
 

Thanks Cathal but I have already tried to add enableSessionState="true" in web config file. It was take reference from this link.

 After setting in web config from reference link, I does not able to see Home Page also and Event Log table showing me same error message as I posted in my question.

I have already research in Google about this  error but couldn't succeed and finally posted here.


- Keval
 
New Post
5/1/2015 2:32 AM
 

Before The Error:

I have added my DNN website as Sub Directory in my local IIS server so my access URL has become http://localhost/WebsiteName/. For some of the reason in DNN core libraries it doesn't work with sub directory and faced error enableSessionState is set to true, either in a configuration file or in the Page directive in my local computer but On live, It was installed as Default Web Site on IIS Server.

Error Resolved:

Just replace my website from sub directory to Default Web Site in IIS Server and it works. I didn't get any error. So, now access URL become http://localhost/

I checked both websites set in same application pool as well as same dotnet framework version but sub directory website doesn't work and when I set it to in the place of default IIS website it works.

For visitors of this post:

If you don't able to solve this error, you can go with Cathal Connoly's answer.


- Keval
 
New Post
5/3/2015 9:28 AM
 
that suggests that in your root directory was an asp.net website - web.config values are hierarchial, so any in the root directory apply to your subfolder

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...EnableSessionState is set to true error in all DNN pagesEnableSessionState is set to true error in all DNN pages


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out