如何设置超过20分钟以上会话超时?

编程入门 行业动态 更新时间:2024-10-23 21:34:14
本文介绍了如何设置超过20分钟以上会话超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的项目中的一个问题。有一个在我的网站管理面板。人们可以用一个用户名登录名和密码可以修改网站内容。有时用户可能需要长达30-40分钟进入内容,但会话超时20分钟后才到期。

I have a problem in my project. There is an admin panel in my website. People can login with a username and password can edit website content. Sometimes a user can take up to 30-40 minutes to enter content, but the session timeout expires after only 20 minutes.

我试着在的web.config配置此,例如:

<authentication mode="Windows"/> <sessionState timeout="60" />

和这样的:

<system.web> <sessionState timeout="60"></sessionState> </system.web>

和还试图在我的窗体像:

and also tried in my form like that:

if (ds.Tables["LOG"].Rows.Count > 0) { Session["IsLoggedIn"] = "true"; Session.Timeout = 60; Response.Redirect("Default.aspx"); } else { Label1.Text = "Username/Password is wrong!!"; }

以上工作的解决方案都不是。我想每个单独和共同的,但20分钟后该会话仍然超时。

None of the solutions above worked. I tried each separately and together, but the session still expires after 20 minutes.

推荐答案

另一个提示是看看你的IIS设置。当我不得不改变我超时,我不得不做出一些服务器端的变化,以及。检查空闲超时设置应用程序池。如果网站进入空闲状态(我认为的5分钟默认值),那么该应用程序池关闭,以节省服务器资源。这将终止会话,以及。

Another hint is to have a look at your IIS settings. When i had to change my timeouts I had to make some server side changes as well. Check the Idle Time-out setting for the application pool. If the site goes idle (i think default of 5 min) then the application pool shuts down to save server resources. This will kill a session as well.

尝试增加空闲超时应用程序池,看看这有助于在所有。

Try increasing the Idle Time-out for the application pool to see if this helps at all.

IIS»目录»配置»选项和程序池»属性

IIS » Directory » Config » Options AND AppPool » Properties

显然,如果你是在一个共享的托管环境,你将最有可能无法适应这一点。

Obviously if you are in a shared hosting environment you will most likely not be able to adjust this.

更多推荐

如何设置超过20分钟以上会话超时?

本文发布于:2023-11-26 12:57:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633969.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何设置

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!