Solved

System.Web.SessionStateModule error issue

Posted on 2013-05-26
1
1,292 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:
sedgwick earned 500 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now