?
Solved

System.Web.SessionStateModule error issue

Posted on 2013-05-26
1
Medium Priority
?
1,477 Views
Last Modified: 2013-05-30
Hello Experts,

We are facing below error when any of the user is trying to access a page which is having session.

The error is not visible on website.
Website works fine but we are having large number of entries in our database for this.

Also we have mailing functionality for the errors so we are receiving large number of emails too.

Below is the error :

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.

Find the code of web.config file below,

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
  <configSections>
    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
    <section name="paypal" type="com.paypal.sdk.core.ConfigSectionHandler, paypal_base" />
   
  </configSections>
  <paypal>
    <endpoints>
      <wsdl>
        <environment name="live">
          <port name="PayPalAPI">https://api.paypal.com/2.0/</port>
          <port name="PayPalAPIAA">https://api-aa.paypal.com/2.0/</port>
          <port name="PayPalAPI" threetoken="true">https://api-3t.paypal.com/2.0/</port>
          <port name="PayPalAPIAA" threetoken="true">https://api-aa-3t.paypal.com/2.0/</port>
        </environment>
        <environment name="sandbox">
          <port name="PayPalAPI">https://api.sandbox.paypal.com/2.0/</port>
          <port name="PayPalAPIAA">https://api-aa.sandbox.paypal.com/2.0/</port>
          <port name="PayPalAPI" threetoken="true">https://api-3t.sandbox.paypal.com/2.0/</port>
          <port name="PayPalAPIAA" threetoken="true">https://api-3t.sandbox.paypal.com/2.0/</port>
        </environment>
      </wsdl>
    </endpoints>
  </paypal>
  
      
  <connectionStrings>
    <add name="connection" connectionString="Server=xxxxx;Database=xxxx;uid=xxxx;pwd=xxxx;" />
  </connectionStrings>
  <system.web>
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
    <compilation debug="true" targetFramework="4.0" defaultLanguage="c#">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
    <customErrors mode="On">
    </customErrors>
    <sessionState timeout="100" />
    <httpRuntime executionTimeout="2097151" requestValidationMode="2.0" maxRequestLength="2097151" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />
    <pages enableSessionState="true" enableViewStateMac="true" validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never" buffer="true" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add tagPrefix="cc1" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
        <add tagPrefix="CKEditor" namespace="CKEditor.NET" assembly="CKEditor.NET" />
      </controls>
    </pages>
    
  <httpModules>
    
     <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
  </system.web>

<rewriter>
   
  <!--Static Pages-->
 
  <rewrite url="~/Home/" to="~/index.aspx" />
  

  </rewriter>

<system.webServer>
	<defaultDocument>
		<files>
			<clear />
      <add value="index.php" />
			<add value="index.html" />
			<add value="index.htm" />
			<add value="default.html" />
			<add value="default.asp" />
			<add value="default.aspx" />
			
			
			
		</files>
	</defaultDocument>
        <handlers accessPolicy="Read, Execute, Script">
            <remove name="StaticFile" />
            <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
        </handlers>
<validation validateIntegratedModeConfiguration="false" />
<modules>
  <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
  <remove name="ScriptModule" />
  
  <!--<add name="ScriptModule" preCondition="managedHandler" />-->
</modules>
</system.webServer>
    
</configuration>

Open in new window


Please review it and provide a solution for this,

Thank you.
0
Comment
Question by:dotsandcoms
1 Comment
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 total points
ID: 39198573
add this lines in your system.webserver -> modules element, in your web.config:
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" />

Open in new window

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question