我正在开发电影票预订网站。我使用会话,因为我想延长会话超时现在使用20分钟作为会话超时,但当用户通过支付网关或当他在支付网关页面。会话超时不应该被执行,或者会话超时应该被延长。是否可以通过global.asax页面实现,或者是否有其他方法
提前感谢
发布于 2014-01-22 13:52:56
您可以在承载应用程序的服务器上的IIS进程中调整应用程序池。默认情况下设置为20分钟。你可以根据你的方便来调整它。
你可以参考这个Link
发布于 2014-01-22 13:12:02
在web.config中。
<system.web>
<compilation debug="true" targetFramework="4.0" />
<sessionState timeout="10"></sessionState>
<httpRuntime executionTimeout="9999" maxRequestLength="10240"/>
.....
</system.web> 它会将会话时间设置为10分钟
在Global.asax文件中,我们可以像这样在Session_Start事件中设置会话超时
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Session.Timeout = 15;
}为您登录的特定会话添加以下代码行。
发布于 2014-01-22 16:10:45
您可以使用“滑动”会话超时,这将覆盖您的场景。下面是一个这样做的例子。
How to do both sliding and absolute timeout in asp.net forms authentication
希望这能有所帮助。
https://stackoverflow.com/questions/21274587
复制相似问题