我已阅读少量帖子,但我不确定是否缺少某些内容,但我的Cookie超时时间很短。饼干超时一分钟后超时,即使我已将它设置为60分钟
这是我在我的web.config已设置:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
<add key="suburbanServiceUrl" value=""/>
</appSettings>
<system.web>
<sessionState
mode="InProc"
cookieless="false"
timeout="60"
/>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<!-- timeout: Gets and sets the amount of time, in minutes, allowed between requests
before the session-state provider terminates the session. -->
<forms loginUrl="~/Account/LogOn" timeout="60"/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="30"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
applicationName="webportal"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="webportal"/>
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="webportal"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="webportal"/>
</providers>
</roleManager>
<pages enableSessionState="true">
<namespaces>
<add namespace="System.Web.Helpers"/>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<remove name="Session"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</modules>
<httpProtocol>
</httpProtocol>
<staticContent>
<clientCache cacheControlCustom="public"
cacheControlMaxAge="00:00:01" cacheControlMode="UseMaxAge" />
</staticContent>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我拿出连接字符串和servicemodel。
在IIS中我有这一套:
我相信我拥有了一切设置为60分钟,但它绝对不是持续那么久。
任何人都可以看到我缺少的东西吗?
编辑
对不起,我包括在我处理超时问题在这里走出习惯的会话信息。无论如何,正如我告诉西蒙哈尔西下面:
我指的是会员cookie。我在一分钟左右后回到登录页面。我有[正在授权]我正在调用的方法,在我几分钟内无效后将其发送回登录屏幕
您可能想从您的配置文件中删除该密码。你永远不知道某人可能会用它做什么。 –
ty以为我得到了一切。幸运的是,它只是办公室的一个开箱。 – ErocM