2015-10-01 39 views
0

我web.config中有這樣的System.Web節:asp.net會話超時不存在的

<system.web> 
 
    <httpHandlers> 
 
     <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" /> 
 
    </httpHandlers> 
 
    <compilation debug="true" targetFramework="4.5.1"> 
 
     <assemblies> 
 
     <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" /> 
 
     </assemblies> 
 
     <buildProviders> 
 
     <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, &#xA;Microsoft.ReportViewer.WebForms, &#xA;Version=11.0.0.0, Culture=neutral, &#xA;PublicKeyToken=89845dcd8080cc91" /> 
 
     </buildProviders> 
 
    </compilation> 
 
    <pages theme="Padrao" validateRequest="false" controlRenderingCompatibilityVersion="4.0" clientIDMode="Static"> 
 
     <controls> 
 
     <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" namespace="Microsoft.Reporting.WebForms" tagPrefix="rsweb" /> 
 
     </controls> 
 
    </pages> 
 
    <sessionState timeout="1" /> 
 
    <httpRuntime targetFramework="4.5.1" maxRequestLength="2097151" /> 
 
    </system.web>

但在我的應用程序,會話永不過期。 我總是可以獲取會話變量值。

我在配置中忘記了什麼?

回答

0

確保系統的源代碼沒有設置Session.Timeout值

或者使用:

**

<system.web> 
    <authentication mode="Forms"> 
      <forms timeout="1"/> 
    </authentication> 
    <sessionState timeout="1" /> 
</system.web> 

**

+0

沒work.When我去到下一個頁面,我仍然可以得到會話變量中的值。 – abeppler