如何设置超过20分钟以上会话超时? [英] How to set session timeout more than 20 min.?

查看:361
本文介绍了如何设置超过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分钟以上会话超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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