Global.asa not firing...

I am currently working on a web app that uses global.asa to set Application-wide variables (using Session_OnStart).  When I was working from a Windows 2000 Server development server, methods in Global.asa worked correctly.  Now I am off-site, I have transferred to a Windows 2000 Pro machine and am using IIS/localhost to develop the app and the Global.asa events do not fire.

The Windows 2000 Server development environment was set up using Interdev but the Windows 2000 Pro environment has been done manually via Internet Services Manager.  Both environments have Read, Execute and Write (where I need it)

Is there something I have missed in my setup, or does Pro not support Global.asa?

J.
LVL 16
jimbobmcgeeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nurbekCommented:
make sure that global.asa is on a root folder

or create a virtual directory "mywebsite" (path c:\websites\myweb)
and put the global.asa into c:\websites\myweb

run your asp file from http://localhost/myweb

also to check your globals asa
put
Response.Write "global.asa works"
into session on start event
0
nurbekCommented:
should be
run your asp file from http://localhost/mywebsite 
0
jimbobmcgeeAuthor Commented:
I have my app working from a VD -- http://localhost/jimbobmcgee -- and global.asa is indeed in this folder.  It should write to a log file (for debug purposes) in Session_OnStart but the log is not created.  More importantly, my Application variables are not set.

I tried putting

    Response.Write("Global.asa is firing...")
    Response.End

at the top of the Session_OnStart routine but it did not return this.

J.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

nurbekCommented:
try the below code

test.asp
---------------------
<%
Response.Write("<br>Online Users: " & Application("visitors"))
%>

global.asa
---------------
<script language="vbscript" runat="server">
Sub Application_OnStart
Application("visitors")=0
End Sub

Sub Session_OnStart
Response.Write("Session is fired")
Application.Lock
Application("visitors")=Application("visitors")+1
Application.UnLock
End Sub

Sub Session_OnEnd
Application.Lock
Application("visitors")=Application("visitors")-1
Application.UnLock
End Sub

</script>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jimbobmcgeeAuthor Commented:
Just got:

    --------------------------------------------------------

    Online Users:

    --------------------------------------------------------

every time...

J.
0
nurbekCommented:
make sure that session is enabled

to check it
-----test.asp ---
<%
Session("test")="test value"

Response.Write(Session("test"))

%>
0
jimbobmcgeeAuthor Commented:
OK, the above did not work because the IUSR account did not have rwx permissions to the folder.  I have now given this account access to the parent folder and the test app nurbek worked fine.  However, my app is still telling me that the Application variable I need to poll is empty.

So, to recap, I now have 'Read' and 'Script Source Access' set for the VD in IIS and 'Read', 'Read & Execute' and 'List Folder Contents' set on the actual folder, for the IUSR account...

Still the Session_OnStart routine is not fired...

J.
0
jimbobmcgeeAuthor Commented:
OK, so in my test app, I now have:

      <%
            Response.Write("<P> Online Users: " & Application("visitors") & "</P>")

            Session("test") = "hello session"
            Application("test") = "hello application"

            Response.Write(Session("test") & "<BR />")
            Response.Write(Application("test") & "<BR />")
      %>

And I get the response:

      Session is fired
      Online Users: 2

      hello session
      hello application

So I rebuilt my app's VD and it works.  Beats me why it didn't before but, never mind, I'm sorted now.

I'm awarding the points to nurbek for the test code -- at least it enabled me to see that global.asa _should_ be firing, even in Windows 2000 Pro.

Thanks for your time.

J.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.