![](/img/trans.png)
[英]Timeout period Connection Pool and Session does not expires issue in Forms Authentication & ASP.NET Membership
[英]ASP.NET Forms authentication timeout expires too soon
我已經閱讀了很多示例,但是我不知道為什么我的代碼不起作用。 這是我的ASP.NET
項目中web.config
代碼的一部分:
<system.web>
<authentication mode="Forms">
<forms loginUrl="Panel/Login" timeout="525600" slidingExpiration="true" />
</authentication>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="1048576" />
</system.web>
問題是,當我登錄后,在閑置幾分鍾后,當我嘗試請求某些內容時,我導航到“登錄”頁面。 即使我在“登錄”頁面中設置了持久性Cookie,也會發生這種情況!
我試圖增加和減少timeout
屬性。
我試過了slidingExpiration
屬性。
我嘗試了cookieless
屬性。
它們都不起作用!
我在登錄頁面中使用以下代碼:
FormsAuthentication.SetAuthCookie(Username.Text, Remember_Me.Checked);
提前感謝。
您可以嘗試將machineKey添加到您的代碼中:
<machineKey validationKey=”AutoGenerate”
您可以在此處查看更多詳細信息:
http://blog.falafel.com/asp-net-forms-authentication-times-out-on-a-shared-host/
或者這可能在幫助中:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.