会话过期太快并显示空页,但没有重定向到登录页面 [英] session is expiring too quickly and showing null pages with out redirecting to login page

查看:105
本文介绍了会话过期太快并显示空页,但没有重定向到登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有

我已经在我的项目中实现了类型为inproc的会话状态,以便通过应用程序维护数据。我在web.confing中声明如下。



Hi, all
i have implemented session state which is of type inproc in my project to maintain the data through out the application. i have declared in web.confing as follows.

<system.web>
    <pages controlRenderingCompatibilityVersion="4.0"/>
    <compilation debug="true"/>
    <authentication mode="Forms">
      <forms loginUrl="login.aspx" defaultUrl="Consultants.aspx">
      </forms>

    </authentication>


    <authorization>
      <!--<allow users="*"/>-->
      <deny users="?"/>
    </authorization>
    <sessionState mode="InProc" timeout="80"></sessionState>
  </system.web>





但是当没有请求时会话过期太快来到应用程序并显示所有空白页面,但保留显示的所有其他标签,我不知道这里有什么问题,任何人都可以告诉我这个问题的补救措施是什么???



我搜索了一些网站,发现如果我们在global.asax的session_start事件中声明response.redirect(login.aspx),那么它会在会话时间后重定向到login.aspx已经走了,但它也没有用,请帮我解决这个!!!



but session is expiring too quickly when no request the coming to the app and displaying all null pages but remaining all other tabs it is showing, i am not getting what is the problem here, can any one tell me what is the remedy of this problem???

and i have searched some sites and found that if we declare response.redirect("login.aspx") in session_start event of global.asax , then it will redirect to login.aspx after session time has gone, but it is also not working, please help me to solve this!!!

推荐答案

在Global.asax中设置会话时间



set the session time out in Global.asax

protected void Session_Start(object sender, EventArgs e)
{
   Session.Timeout = 80;
}


这篇关于会话过期太快并显示空页,但没有重定向到登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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