Web.Config中会话超时未设置,vb.net [英] Web.Config session timeout not set, vb.net

查看:129
本文介绍了Web.Config中会话超时未设置,vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了大约一百万的帖子在网上关于配置文件会话超时,我几乎要哭出来。我在我的配置文件下code。我已经超时设置为1分钟进行测试。这次会议没有1 minutee内确实结束但是,如果我设置为120(2小时),这是我想要的,20分钟,我相信默认时间后会话结束。任何人都可以提供一些帮助。

<?XML版本=1.0&GT?;
<结构>
<&的System.Web GT;
&所述;的sessionState模式=是InProc无Cookie =假超时=1>
< /&的sessionState GT;
<编译调试=真/>
<身份验证模式=表格>
<形式defaultUrl =〜/ Default.aspx的
    loginUrl =〜/ Default.aspx的
    NAME =。ASPXFORMSAUTH
    slidingExpiration =真
    超时=1/>
< /认证>
<的customErrors模式=关/>
 < /system.web>
 < /结构>


解决方案

如果一个应用程序池闲置20分钟将默认回收,见下图。

请参阅此微软发布有关更改默认。

更新结果
如果您没有访问的 IIS应用程序池设置的你可以尝试添加以下到你的的web.config 然而,推荐的方法是通过 IIS

 <结构>
   <&的System.Web GT;
      <的sessionState模式=是InProc超时=120/>
   < /system.web>
< /结构>

I have read about a million posts online regarding session timeout in config file and I am near tears. I have the following code in my config file. I have set the timeout to 1 minute as a test. The session does indeed end within 1 minutee however, if I set to 120 (2 hours) which is what i want, the session end after the default time of 20 minutes i believe. Can anyone offer some help.

<?xml version="1.0"?>
<configuration>
<system.web>
<sessionState mode="InProc" cookieless="false" timeout="1" >
</sessionState> 
<compilation debug="true"/>
<authentication mode="Forms">
<forms defaultUrl="~/Default.aspx"
    loginUrl="~/Default.aspx"
    name=".ASPXFORMSAUTH"
    slidingExpiration="true"
    timeout="1" />
</authentication> 
<customErrors mode="Off" />
 </system.web>
 </configuration>

解决方案

If an app pool is idle for 20 minutes it will recycle by default, see image below.

See this Microsoft post about changing the default.

UPDATE
If you do not have access to the IIS Application Pool Settings you can try the adding the following to your web.config however the recommended approach is via IIS

<configuration>
   <system.web>
      <sessionState mode="InProc" timeout="120" />
   </system.web>
</configuration>

这篇关于Web.Config中会话超时未设置,vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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