0

My Session_OnStart in my golbal.asa file won't fire on one machine but works as expected on the other. Both machines are Windows server 2003 with IIS6. Here is my code.

global.asa

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
    Sub Application_OnStart
        Application.Lock()
        Application("INSESSION") = "NO"
        Application.Unlock()
    End Sub

    Sub Application_OnEnd
    End Sub

    Sub Session_OnStart
        Application("INSESSION") = "YES"
    End Sub

    Sub Session_OnEnd
    End Sub
</SCRIPT>

test.asp
<%
    response.Write Application("INSESSION")
%>

Value of the application variable is always "NO". Do you guys have any suggestions?

1
  • Never mind. Got the answer. Session state is disabled in IIS on the machine which is causing the issue. Sep 19, 2013 at 4:05

1 Answer 1

1

Session state was disabled in IIS on the machine which is causing the issue. After I enabled Session state, Session_OnStart in my golbal.asa file started working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.