文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>session state inproc optimization

session state inproc optimization

时间:2010-09-13  来源:搂着鱼睡的猫

If we are in InProc mode, and cookieless=false,in certain scenarios we can avoid reading the session ID from cookies because that's an expensive operation.To allow that,we use s_sessionEverSet to keep track of whether we've ever created any session state.

If no session has ever be created,we can optimize in the following two cases:

Case 1: Page has disabled session state

In BeginAcqurieState, we usually read the session ID, and reset the timeout value of the session state. However, since no session has been created, we can skip both reading the session id and resetting the timeout.

Case 2: Page has enabled session state

In this case, we will delay reading(and creating it if not found) the session ID until it’s really needed.(e.g. from HttpSessionStateContainer.SessionID)

Please not that SessionStateModule optimizes only if the application is using SessionIDManager as the session ID provider; otherwise, we do not have knowledge about the provider in order to optimize safely.

And we will delay reading the id only if we are using cookie to store the session ID. If we use cookieless, in the delayed session ID creation scenario, cookieless requires a redirect, and it’ll be bad to do that in the middle of a page execution.

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载