문제

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