Thứ Tư, 9 tháng 4, 2014

[ASP.NET][IIS] SesstionState : Session state can only be used when enableSessionState is set to true

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.

You need to :

1. include a <pages... > attribute in web.config :

<pages enableSessionState = "true" />

*or*

2. enable SessionState in the <%@ Page ...%> directive in your page :

<%@ Page enableSessionState = "true" %>

Also, the System.Web.SessionStateModule should exist in your
<httpModules> section in the application configuration.

Hoặc:
Vào IIS -> site -> modules -> session bỏ check mục “Invoke only for request to ASP.NET applications or managed handler”

Không có nhận xét nào: