【发布时间】:2015-04-06 15:51:30
【问题描述】:
我在 myasp.net 中有 asp 主机,我尝试将会话超时更改为 24 小时,但几分钟后服务器仍断开用户连接。 我尝试使用 c# 代码,例如:
Session.Timeout = 3600;
这是 web.config 的样子:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="owin:AutomaticAppStartup" value="false"/>
</appSettings>
<system.web>
<sessionState mode="InProc" cookieless="false" timeout="80" />
<authentication mode="Forms">
<forms timeout="60" />
</authentication>
<trace enabled="true" pageOutput="false" requestLimit="40" localOnly="false" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime executionTimeout="180" targetFramework="4.5" maxRequestLength="13107200" />
<customErrors mode="Off" />
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
这个问题有解决办法吗?
【问题讨论】:
-
在 IIS 中设置的超时时间是多少?你有没有检查那里进行设置更改