如何在asp.net Web应用程序中增加会话时间 [英] how to increase session time in an asp.net web application

查看:91
本文介绍了如何在asp.net Web应用程序中增加会话时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,



我想在我的网络应用程序中增加会话超时时间我在Global.asax文件中使用了以下代码来增加会话时间: br $>




无效Session_Start(对象发件人,EventArgs e)

{



Session.Timeout = 30;



}



但仍然在用户之后登录会话时间随机过期。我该怎么办呢??



谢谢

sunil sharma

Hello friends,

I want to increase session time out period in my web application I have used following code in Global.asax file to increase session time :


void Session_Start(object sender, EventArgs e)
{

Session.Timeout = 30;

}

But still after user login session time is expired randomly. What should i do right now..?

thanks
sunil sharma

推荐答案

Include this in you web.config file:

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


Include this in you web.config file:

<system.web>
        <sessionState cookieless="false" timeout="540"/>
</system.web>


Hi Sunil,



我认为这一定会对你有所帮助:

http://stackoverflow.com/questions/648992/session- timeout-in-asp-net / 650126#650126 [ ^ ]





希望这会有所帮助!



快乐编码:)
Hi Sunil,

I think this will definitely help you:
http://stackoverflow.com/questions/648992/session-timeout-in-asp-net/650126#650126[^]


Hope this helps!

Happy Coding :)


这篇关于如何在asp.net Web应用程序中增加会话时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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