SessionStateModule Class

Discussion in 'ASP .Net' started by wjs wsl, Feb 9, 2007.

  1. wjs wsl

    wjs wsl Guest

    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.




    *** Sent via Developersdex http://www.developersdex.com ***
     
    wjs wsl, Feb 9, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd Throne
    Replies:
    4
    Views:
    656
    bruce barker
    Oct 1, 2004
  2. Daniel Carlsson

    Custom SessionStateModule

    Daniel Carlsson, Jan 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,842
    =?Utf-8?B?UnVsaW4gSG9uZw==?=
    Jan 26, 2005
  3. E11
    Replies:
    1
    Views:
    4,784
    Thomas Weidenfeller
    Oct 12, 2005
  4. wjs wsl

    SessionStateModule Class?

    wjs wsl, Feb 8, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    369
    wjs wsl
    Feb 8, 2007
  5. Jeff Fritz
    Replies:
    1
    Views:
    222
    Bob Barrows [MVP]
    Mar 12, 2008
Loading...

Share This Page