Global.asa not firing

Q

qaz

For some reason my global.asa file is not firing. I have it located in the
root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the web
site configured as an "application" in IIS. When I modified the file I also
stopped and restarted the web server.

Can anyone give me some ideas as to why it is not firing?

Thanks
 
Q

qaz

My evidence is pretty good. In Application_OnStart I created an application
variable named Application("test") and set it equal to "Application". In
Session_OnStart I set a session variable called session("test") = "Session".
I put response.write statements in test.asp and fired the page.
 
L

Lance Wynn

Make sure mywebsite is setup as an application, and not a subdirectory of
the parent web. If it is a subdirectory, the root global.asa will fire
instead.

For some reason my global.asa file is not firing. I have it located in the
root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the web
site configured as an "application" in IIS. When I modified the file I also
stopped and restarted the web server.

Can anyone give me some ideas as to why it is not firing?

Thanks
 
J

John Blessing

Make sure session cookies are enabled in your browser - Tools, Internet
Options, Privacy, Advanced, check the box "Always allow session cookies"

If you are using IE 5.5 or IE 6.0, and your local server name has an
underscore or other non-alphanumeric character (other than a dash) in the
name, then cookies will not work correctly. One workaround is to access the
machine by IP address; others include renaming the server or at least adding
an entry to the clients' hosts files, or alter your local DNS/WINS, or add a
new host header to the web server, with a more friendly name. For more info,
search http://msdn.microsoft.com/ for Q312461 and Q316112.

Make sure you haven't disabled session state in Internet Services Manager,
and that it has an appropriate timeout value:
Open the Internet Services Manager MMC tool, and expand 'Web Sites'
Right-click 'Default Web Site' or the application in question, and select
'Properties'
On the 'Home Directory' tab, click the 'Configuration...' button
On the 'Options' tab, make sure 'Enable session state' is checked and that
the timeout value (in minutes) is sufficient.


Also, try removing and re-creating the application in the Internet Services
Manager MMC tool. this often fixes problems like this.



--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
 
E

Evertjan.

John Blessing wrote on 23 jan 2005 in
microsoft.public.inetserver.asp.general:
Make sure session cookies are enabled in your browser - Tools, Internet
Options, Privacy, Advanced, check the box "Always allow session cookies"

This has nothing to do with:

response.write application("started")
 
Q

qaz

Very helpful response - unfortunately I still have the problem. Session
cookies are enabled in the browser (I use them successfully on other pages);
I have no "funny" characters in the local server name; Session State is
enabled in internet services manager and timeout is 20 min; I deleted the
website in IIS (v6) and recreated it. Ugh! It still does not fire
global.asa.

Below is a complete copy of my global.asa file, if that would help:


<SCRIPT LANGUAGE=VBScript RUNAT=Server>
'=======================================================================
Sub Application_OnStart

Application.Lock
Application("CurrentUsers") = 0
Application("test") = "Application"
Application.Unlock

End Sub
'=======================================================================
Sub Session_OnStart

Application("CurrentUsers") = Application("CurrentUsers") + 1

session("test") = "Session"

session("IDUser") = 0

'--- force all users to begin on home page ---
response.redirect "default.asp"
End Sub
'===========================================================================
====
Sub Session_OnEnd
Application("CurrentUsers") = Application("CurrentUsers") - 1
End Sub
'===========================================================================
====
Sub Application_OnEnd

End Sub
</SCRIPT>
 
A

Aaron [SQL Server MVP]

Wow, this content looks familiar. If you're going to post others' content
as if it were your own, you would show much more respect if you either cite
the source, or take the time to put it into your own words.

http://www.aspfaq.com/2157
 
J

John Blessing

Hi

My apologies, I have bunch of faq stuff in a macro file, I hadn't realised
it came from aspfaq originally. . Sometimes the users I deal with don't
have internet access and so it is best to give them the answer directly.
 
E

Evertjan.

qaz wrote on 23 jan 2005 in microsoft.public.inetserver.asp.general:
[please do not toppost on usenet]
Sorry, I don't know what you are talking about. What is
application("started")?


Any application variable you defined and filled in global.asa:

Sub Application_OnStart
Application("myTest") = "Yes Sir"
End Sub


Can be shown in a file test.asp like this:

<%
Response.Write Application("myTest")
%>

Isrrespective of if the browser suppordt session variables.
 
Q

qaz

It is setup as an application and it is not in a subdirectory of a parent.

Any other suggestions?
 
T

Terri Morton

Check the error log for the IIS server for clues.

Try commenting out the response.redirect in the Session_OnStart to see if
that makes a difference.

Try removing the Session_OnStart and Session_OnEnd and then testing your
Application variables.


Terri Morton
MVP - ASP/ASP.NET
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Global.asa 5
ASP, GLOBAL.ASA 4
Global.asa 19
Global.asa 0
ENABLESESSIONSTATE and Global.asa 4
global.asa not execute 3
global.asa in subdirectory 4
Basic Questions about Global.asa from a beginner 1

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top