GLOBAL.ASA: Comments/Troubleshooting

When you make changes to the GLOBAL.ASA file for an application, the web server completes all current requests for the given application before recompiling the GLOBAL.ASA file. According to Microsoft, once the current requests are processed, the file is recompiled, and any new sessions started in the current application trigger the processing of the GLOBAL.ASA file code. During this re-compilation, the server ignores all new requests for scripts within the application. Unfortunately, the reality is that this does not work at all with Personal Web Server, IIS 3.0, and IIS 4.0. You are forced to reboot the machine before the new GLOBAL.ASA is processed!

Note that any sessions that remain current during this time are unaffected by your changes to GLOBAL.ASA. Once the web server has recompiled the GLOBAL.ASA file, all active sessions are deleted and the Session_OnEnd and Application_OnEnd event procedures in the (new) GLOBAL.ASA file are called. The users must make a new request in the web application for new sessions to begin. All new sessions will start with processing of the new GLOBAL.ASA file.

An important consideration for developing your own GLOBAL.ASA files is that changing any code included in the file through the use of a Server-Side Include does not result in the recompilation of the GLOBAL.ASA file by the web server. You must actually resave the GLOBAL.ASA file (even if it hasn't changed!) to trigger its recompilation.

You can have procedures ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.