在asp.net中延长会话过期时间 [英] extend session expire time in asp.net

查看:85
本文介绍了在asp.net中延长会话过期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在用户登录时在asp.net4.0中开发了一个网站,然后20分钟后自动会话期满,并且用户再次进入登录页面并重新登录.
我想将会话状态值扩展到4小时,这是可能的.

谢谢

i have developed a website in asp.net4.0 in this website when user Log in then after 20 minutes automatic session expires and user go to again login page and re login .
i want to extend session state value to 4 hours how it is possible.

Thank You

推荐答案

增加Web.Config文件中的超时时间:
Increase the timeout in the Web.Config file:
<system.web>
  <sessionState mode="InProc" timeout="240"></sessionState>
</system.web>


如果这是您真正要设置的时间,则会将Web应用程序的超时设置为240分钟.


This would set the timeout as 240 minutes for your web application if that''s what you really want to set.


从您的网站打开web.config文件并设置此参数.

Open web.config file from your website and set this parameter.


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


打开web.config并在< system.web>之后键入此代码.标签:
Open web.config and type this code after <system.web> tag:
<sessionstate timeout="4" mode="InProc"></sessionstate>



HttpSessionState.Timeout属性



HttpSessionState.Timeout Property


这篇关于在asp.net中延长会话过期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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