ENABLESESSIONSTATE and Global.asa

Discussion in 'ASP General' started by abcd, Jul 20, 2005.

  1. abcd

    abcd Guest

    I have an asp page in which first line is

    <@ ENABLESESSIONONSTATE = false %>

    I want to stop the sessions for this page. I have global.asa page whose code
    is like this

    <SCRIPT RUNAT=Server Language=VBScript>
    Sub Session_OnStart
    Session("XYZ") = False
    Session("ABC") = true
    End Sub
    </script>

    When IIS is restarted and hit my asp page it goes to global.asa
    session_onStart though I have disabled sessions on my page.

    I dont want to execute global.asa at all when session is disabled on the
    page....I get this wrong behavior only when IIS is restarted and page is hit
    for the first time....for successive hits it doesnt go to global.asa and
    keeps the session disable on the page....

    I have tested for this 2 scenarios and I get the satisfactory results as per
    my desire

    1. u create a web application in IIS and disable session (by unchecking
    "Enable Session State") , the page does not go to global.asa
    2. if you dont create a web application and keep just a folder or a virtual
    directory then the page does not go to global.asa

    any clues why it goes to global.asa in other cases.

    thanks
    abcd, Jul 20, 2005
    #1
    1. Advertising

  2. abcd

    abcd Guest

    My first line in my asp page is as below

    <%@ EnableSessionState = False %>

    [in earlier post I had typed it wrong but my code has correct line as above.
    Still my issue is the same as per previous post]



    "abcd" <> wrote in message
    news:...
    >I have an asp page in which first line is
    >
    > <@ ENABLESESSIONONSTATE = false %>
    >
    > I want to stop the sessions for this page. I have global.asa page whose
    > code is like this
    >
    > <SCRIPT RUNAT=Server Language=VBScript>
    > Sub Session_OnStart
    > Session("XYZ") = False
    > Session("ABC") = true
    > End Sub
    > </script>
    >
    > When IIS is restarted and hit my asp page it goes to global.asa
    > session_onStart though I have disabled sessions on my page.
    >
    > I dont want to execute global.asa at all when session is disabled on the
    > page....I get this wrong behavior only when IIS is restarted and page is
    > hit for the first time....for successive hits it doesnt go to global.asa
    > and keeps the session disable on the page....
    >
    > I have tested for this 2 scenarios and I get the satisfactory results as
    > per my desire
    >
    > 1. u create a web application in IIS and disable session (by unchecking
    > "Enable Session State") , the page does not go to global.asa
    > 2. if you dont create a web application and keep just a folder or a
    > virtual directory then the page does not go to global.asa
    >
    > any clues why it goes to global.asa in other cases.
    >
    > thanks
    >
    >
    abcd, Jul 20, 2005
    #2
    1. Advertising

  3. "abcd" <> wrote in message
    news:...
    >I have an asp page in which first line is
    >
    > <@ ENABLESESSIONONSTATE = false %>
    >
    > I want to stop the sessions for this page. I have global.asa page whose
    > code is like this



    Hi,

    To avoid hitting global.asa you should disable the session using the IIS
    management console.

    --
    compatible web farm Session replacement for Asp and Asp.Net
    http://www.nieropwebconsult.nl/asp_session_manager.htm


    > <SCRIPT RUNAT=Server Language=VBScript>
    > Sub Session_OnStart
    > Session("XYZ") = False
    > Session("ABC") = true
    > End Sub
    > </script>
    >
    > When IIS is restarted and hit my asp page it goes to global.asa
    > session_onStart though I have disabled sessions on my page.
    >
    > I dont want to execute global.asa at all when session is disabled on the
    > page....I get this wrong behavior only when IIS is restarted and page is
    > hit for the first time....for successive hits it doesnt go to global.asa
    > and keeps the session disable on the page....
    >
    > I have tested for this 2 scenarios and I get the satisfactory results as
    > per my desire
    >
    > 1. u create a web application in IIS and disable session (by unchecking
    > "Enable Session State") , the page does not go to global.asa
    > 2. if you dont create a web application and keep just a folder or a
    > virtual directory then the page does not go to global.asa
    >
    > any clues why it goes to global.asa in other cases.
    >
    > thanks
    >
    >
    Egbert Nierop \(MVP for IIS\), Jul 20, 2005
    #3
  4. abcd

    abcd Guest

    Theortically it says that when a page includes EnableSessionState = false it
    stops the session though Session is enabled in IIS management
    console....then why this is not happening for that page after IIS
    restart....

    thanks


    "Egbert Nierop (MVP for IIS)" <> wrote in
    message news:...
    > "abcd" <> wrote in message
    > news:...
    >>I have an asp page in which first line is
    >>
    >> <@ ENABLESESSIONONSTATE = false %>
    >>
    >> I want to stop the sessions for this page. I have global.asa page whose
    >> code is like this

    >
    >
    > Hi,
    >
    > To avoid hitting global.asa you should disable the session using the IIS
    > management console.
    >
    > --
    > compatible web farm Session replacement for Asp and Asp.Net
    > http://www.nieropwebconsult.nl/asp_session_manager.htm
    >
    >
    >> <SCRIPT RUNAT=Server Language=VBScript>
    >> Sub Session_OnStart
    >> Session("XYZ") = False
    >> Session("ABC") = true
    >> End Sub
    >> </script>
    >>
    >> When IIS is restarted and hit my asp page it goes to global.asa
    >> session_onStart though I have disabled sessions on my page.
    >>
    >> I dont want to execute global.asa at all when session is disabled on the
    >> page....I get this wrong behavior only when IIS is restarted and page is
    >> hit for the first time....for successive hits it doesnt go to global.asa
    >> and keeps the session disable on the page....
    >>
    >> I have tested for this 2 scenarios and I get the satisfactory results as
    >> per my desire
    >>
    >> 1. u create a web application in IIS and disable session (by unchecking
    >> "Enable Session State") , the page does not go to global.asa
    >> 2. if you dont create a web application and keep just a folder or a
    >> virtual directory then the page does not go to global.asa
    >>
    >> any clues why it goes to global.asa in other cases.
    >>
    >> thanks
    >>
    >>

    >
    abcd, Jul 20, 2005
    #4
  5. "abcd" <> wrote in message
    news:...
    > Theortically it says that when a page includes EnableSessionState = false
    > it stops the session though Session is enabled in IIS management
    > console....then why this is not happening for that page after IIS
    > restart....



    This is by design because global.asa cannot know that **all** or just a
    **few** pages have the sessionstate turned of.
    the ASP framework, therefore, always creates a session cookie. After that,
    it is not reused in your case.

    Only by disabling it by the IIS it is disabled for global.asa as well.
    And the enablesessionstate = false does not work for global.asa (might not
    be documented...).

    Success
    --
    compatible web farm Session replacement for Asp and Asp.Net
    http://www.nieropwebconsult.nl/asp_session_manager.htm


    > thanks
    >
    >
    > "Egbert Nierop (MVP for IIS)" <> wrote in
    > message news:...
    >> "abcd" <> wrote in message
    >> news:...
    >>>I have an asp page in which first line is
    >>>
    >>> <@ ENABLESESSIONONSTATE = false %>
    >>>
    >>> I want to stop the sessions for this page. I have global.asa page whose
    >>> code is like this

    >>
    >>
    Egbert Nierop \(MVP for IIS\), Jul 22, 2005
    #5
    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. Wayne
    Replies:
    2
    Views:
    466
    Wayne
    Nov 11, 2003
  2. Jeffry van de Vuurst
    Replies:
    0
    Views:
    2,099
    Jeffry van de Vuurst
    May 18, 2004
  3. Raghu
    Replies:
    1
    Views:
    4,039
    Raghu
    Feb 17, 2005
  4. Brad

    Global.asa and EnableSessionState

    Brad, Oct 16, 2003, in forum: ASP General
    Replies:
    0
    Views:
    144
  5. Brad
    Replies:
    0
    Views:
    116
Loading...

Share This Page