ASP.NET会话状态不会在Web.config中工作以及Global.asax中 [英] ASP.NET Session State not working in Web.config as well as Global.asax

查看:136
本文介绍了ASP.NET会话状态不会在Web.config中工作以及Global.asax中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有管理页面,其中我用做一些升级工作,为我的网站。问题是会话将一分钟或在30秒内期满,并且将注销用户。我已经设置了会话中的根文件夹中的Web.Config,以及在管理文件夹内的Web.Config中,但仍然会话被很快过期。我已它设定为60分钟,但它仅持续30秒或一分钟之内。这是根文件夹的我的的web.config含量

I have Admin Page wherein I use to do some update work for my site. The problem is the session will expire within a minute or 30 seconds and will logout the user. I have set the Session in Web.Config of the root folder as well as in the Web.Config inside the Admin folder but still the session gets expired soon. I have set it to 60 minutes but it only lasts for 30 seconds or within a minute. Here is my web.config content of root folder

<sessionState timeout="60" mode="InProc" 
      cookieless="false"></sessionState>


    <customErrors mode="Off">
    </customErrors>
    <trace enabled="true" />
    <authentication mode="Forms">
               <forms
    protection="All"
    timeout="120"
    domain="www.marpallichande.in"
    slidingExpiration="true"
    name="auth_cookie" />  

    </authentication>

这是我web.cofing管理文件夹中的文件设置

<sessionState timeout="60" mode="InProc"
      cookieless="false"></sessionState>

这是根据在session_start方法我在Global.asax文件设置

Session.Timeout=60;

我没有得到怎么会是越来越这么快过期或有任何其他理由比会话已经越来越登出等。

I am not getting how the session is getting expired so soon or is there any other reason for been getting logged out other than session.

推荐答案

的sessionState超时值以分钟为单位。我会通过删除查看Session.Timeout(以及任何其他超时值除的sessionState超时开始,离开它,因为它,并给它一个尝试。另外,不知道为什么你有两个配置文件?他们有相同的设置?

sessionState timeout value is in minutes. I would start by removing Session.TimeOut (and any other timeout values except sessionState timeout, leave it as it is and give it a try. Also, not sure why you have two config files? Do they have same settings?

我有一个类似的设置,但只有一个配置文件

I have a similar setup but just one config file with

<sessionState mode="InProc" cookieless="false" timeout="10" /> 

将其设置为10分钟。

setting it to 10 minutes.

这篇关于ASP.NET会话状态不会在Web.config中工作以及Global.asax中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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