Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive.

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.

Simple Way to fix it in ASP.Net

In Web config, add below code, out of system.web

 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
    </modules>
   
  </system.webServer>

FREE!!! Registration