Context.SetSessionStateBehavior对会话超时的使用和影响

时间:2013-10-14 21:25:38

标签: c# asp.net session-state session-timeout

使用HttpContext.SetSessionStateBehavior Method时,如果我们禁用会话状态,如:

protected void Application_BeginRequest(object sender, EventArgs e)
{        
    if (!Context.Request.Path.EndsWith("/Service.svc"))
    {
        Context.SetSessionStateBehavior(SessionStateBehavior.Default);
    }
    else
    {
        Context.SetSessionStateBehavior(SessionStateBehavior.Disabled);
    }
}

在Global类的Application_BeginRequest方法中,这是否意味着我们设置SessionStateBehavior.Disabled的任何请求都不会延长现有会话?换句话说,禁用会话状态行为的请求会重置HttpSessionState.Timeout计时器吗?

0 个答案:

没有答案