本文介绍了了解ASP.Net会话续航时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感到困惑ASP或ASP.Net会话生命时间(或生命周期)的概念。更具体地讲,我的困惑是:


  1. 如何IIS决定何时启动新会话和现有会话结束?尤其是如何决定的IIS会话是否继续或结束时,我们称之为重定向code?

  2. 我们如何设置会话过期的时间? (目前我只知道通过的web.config的sessionState 项目来设置它。)

  3. 是否有可能在一个会话访问另一个会话的变量?


解决方案

  1. 会话开始,因为该请求不包含会话cookie,或者它确实包含不再映射到一个会话的会话cookie。会话被终止)已坐在闲置,引用它的超时周期没有进一步的要求。 b)大会由code故意中止。 c)在处理时的过程确实会死,例如当应用程序被回收。


  2. 不同的方法来改变超时基本上对矫正反正web.config中或从该值是继承的配置文件。


  3. 不,除非会话对象是故意code放置的地方,另一个会话可以访问它。


I am confused about ASP or ASP.Net session life time (or life cycle) concepts. More specifically, my confusions are:

  1. How does IIS decide when a new session starts and an existing session ends? Especially how does IIS decide whether a session continues or ends when we call redirect code?
  2. How can we set session expire time? (Currently I only know to set it through web.config sessionState item.)
  3. Is it possible for one session to access another session's variables?
解决方案
  1. Session starts because the request does not contain a session cookie or the session cookie it does contain no longer maps to a session. A session ends by a) it has sat idle with no further requests referencing it for the timeout period. b) Its deliberately aborted by code. c) In-process session dies when the process does, e.g. when the app is recycled.

  2. Different ways to change the timeout are basically modifing the web.config anyway or a config file from which the value is inherited.

  3. Not unless the session object is deliberately placed by code somewhere that another session can access it.

这篇关于了解ASP.Net会话续航时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 11:22