How to fix Session state is not available in this context IIS Error (Any version of NFA)

Document ID : KB000031314
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:
 
When doing a fresh install of NFA or other products after signing into SSO you can be redirected to a page with this error:
 

Server Error in '/RA' Application.
Session state is not available in this context.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Session state is not available in this context.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:

[HttpException (0x80004005): Session state is not available in this context.]
   System.Web.HttpApplication.get_Session() +2806716
   NetQoS.ReporterAnalyzer.WebSite.Global.Application_PreRequestHandlerExecute(Object sender, EventArgs e) +283
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
 


Version Information: Microsoft .NET Framework Version:2.0.50727.7041; ASP.NET Version:2.0.50727.5479

 

Resolution:

You must turn off session state in your .net config.  It's located in:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config and/or machine.config

and

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\web.config and/or machine.config

Once we changed the setting to turn sessionstate off, the product page will load. 

Usually you would need to remove the configuration section from the Web.config and/or machine.config.

 
 
<configuration>   
  <system.web>     
    <pagesenableSessionState="false" />   
  </system.web>
</configuration>
or
<configuration>   
  <system.web>     
    <pages enableSessionState="ReadOnly"/>   
  </system.web>
</configuration>