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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top