sessionState超时不适用于DefaultSessionProvider [英] The sessionState timeout doesn't work with the DefaultSessionProvider

查看:169
本文介绍了sessionState超时不适用于DefaultSessionProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,在这里我使用ASP.NET成员资格来管理用户创建,登录和角色管理.我使用的是Visual Studio2012.VisualStudio在web.config中创建了很多元素.与会话状态相关的元素之一如下.

I have a web site where I use ASP.NET membership for managing user creation, login, role management. I use Visual Studio 2012. There are a lot of elements created by Visual Studio in web.config. One of the element related to session state is the following.

sessionState mode="InProc" customProvider="DefaultSessionProvider"

name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"

此链接中,它表示在将模式设置为自定义"时使用自定义提供程序.第一个问题是,如果是这种情况,为什么Visual Studio生成会话状态的mode属性为InProc并同时设置自定义提供程序?第二个问题是会话状态超时.当我将超时值添加到会话状态时,时间到了就不会超时.

In this link, it says that Custom provider is used when mode is set to Custom. The first question is that if this is the case why Visual Studio generates the session state's mode attribute as InProc and at the same time sets a custom provider? The second issue is with the session state timeout. When I add a timeout value to session state, it doesn't timeout when the time is up.

sessionState mode="InProc" customProvider="DefaultSessionProvider" timeout="30"

当我删除CustomProvider属性时,超时开始工作.是否有人对此情况有更多了解?

Time out started working when I removed CustomProvider attribute. Does anybody have more inside to this situation?

推荐答案

我意识到有关超时的问题与CustomProvider属性无关.问题在于表单超时和会话状态超时被设置为不同的值.一旦将它们设置为相同的值,它便开始工作.

I realized that the issue about the time out has nothing to do with CustomProvider attribute. The problem was that forms time out and session state time out were set to different values. Once I set them to the same value, it started working.

但是,Visual Studio使用mode = InProc和customProvider = DefaultSessionProvider创建sessionState元素的事实仍然很奇怪,因为Microsoft网站说使用customProvider的唯一时间是将mode设置为Custom时.

But still the fact that Visual Studio creates sessionState element with mode = InProc and customProvider = DefaultSessionProvider is strange since Microsoft web site says that the only time customProvider is used is when mode is set to Custom.

这篇关于sessionState超时不适用于DefaultSessionProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆