即使某些请求即将到达应用程序,会话也会过期到期 [英] session is expiring too quickly even some requests are coming to the application

查看:88
本文介绍了即使某些请求即将到达应用程序,会话也会过期到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

i已经在我的项目中实现了类型为inproc的会话状态,以维护所需的数据,问题是即使我在测试模式下使用这个项目,或者只是为了看到我的项目所包含的页面,会话过期并重定向到登录页面,为什么意味着我无法得到这个,发生了什么,我已经在web.config中声明如下。

hi all,
i have implemented session state which is of type inproc in my project to maintain the required data, the problem is even when i am using this project while testing mode,or for just seeing the pages what my project consists, session is expiring too quickly and redirects to login page, why means i am not able to get this, what is happening, i have declared in web.config as follows.

<system.web>
<authentication mode="Forms">
      <forms loginUrl="login.aspx" defaultUrl="Consultants.aspx"/>
    </authentication>
    <authorization>
      <!--<allow users="*"/>-->
      <deny users="?"/>
    </authorization>
    <sessionState mode="InProc" timeout="80"/>
  </system.web>



我也在global.asax页面的session_start事件中声明为session.timeout = 2880,但不能正常工作,任何人都可以帮助我实现这个目标吗?????


and also i have declared in session_start event of global.asax page as session.timeout=2880, but not working properly, can any one help me to achieve this?????

推荐答案

你必须增加超时 web.config 文件的c $ c>值,您还必须指定允许使用以下示例中的Cookie:

You have to increase the timeout value from your web.config file also you have to specify that you allow cookies like in the next example:
<sessionstate mode="InProc" cookieless="false" timeout="2880" />



请在此处查看详细信息: http://msdn.microsoft.com/en-us/library/ms972429。 aspx [ ^ ]


By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true".

<sessionState mode="StateServer" cookieless="false" timeout="120"/>





查看: Session TimeOut [ ^ ]



这篇关于即使某些请求即将到达应用程序,会话也会过期到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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