SessionStateModule Class

W

wjs wsl

public void Init(HttpApplication app)
{
bool flag1 = false;
SessionStateSection section1 =
RuntimeConfig.GetAppConfig().SessionState;
if (!this.s_oneTimeInit)
{
SessionStateModule.s_lock.AcquireWriterLock();
try
{
if (!this.s_oneTimeInit)
{
this.InitModuleFromConfig(app, section1);
flag1 = true;
if
(!SessionStateModule.CheckTrustLevel(section1))
{

SessionStateModule.s_trustLevelInsufficient = true;
}
SessionStateModule.s_timeout = (int)
section1.Timeout.TotalMinutes;
SessionStateModule.s_useHostingIdentity =
section1.UseHostingIdentity;
if ((section1.Mode == SessionStateMode.InProc)
&& this._usingAspnetSessionIdManager)
{

SessionStateModule.s_allowInProcOptimization = true;
}
if (((section1.Mode != SessionStateMode.Custom)
&& (section1.Mode != SessionStateMode.Off)) &&
!section1.RegenerateExpiredSessionId)
{

SessionStateModule.s_allowDelayedStateStoreItemCreation = true;
}
SessionStateModule.s_configExecutionTimeout =
RuntimeConfig.GetConfig().HttpRuntime.ExecutionTimeout;

SessionStateModule.s_configRegenerateExpiredSessionId =
section1.RegenerateExpiredSessionId;
SessionStateModule.s_configCookieless =
section1.Cookieless;
SessionStateModule.s_configMode = section1.Mode;
this.s_oneTimeInit = true;
}
}
finally
{
SessionStateModule.s_lock.ReleaseWriterLock();
}
}
if (!flag1)
{
this.InitModuleFromConfig(app, section1);
}
if (SessionStateModule.s_trustLevelInsufficient)
{
throw new
HttpException(SR.GetString("Session_state_need_higher_trust"));
}
}
in the above mothed,"s_oneTimeInit" is not static variable,
page postback later that s_oneTimeInit is default value relative to all
user,"if (!this.s_oneTimeInit),if (!this.s_oneTimeInit)"They have not
any effect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top