ASP Application_OnStart and Application_OnEnd Events
Complete Application object reference manual
The Application_OnStart event
The Application_OnStart event occurs before the first new session is created (when the Application object is referenced for the first time).
This event is placed in the Global.asa file.
**Note:** Referencing the Session, Request, or Response object in the Application_OnStart event script causes an error.
The Application_OnEnd event
The Application_OnEnd event occurs when the application ends (when the web server stops running).
This event is placed in the Global.asa file.
**Note:** The MapPath method cannot be used in Application_OnEnd code.
Syntax
Example
Global.asa:
Displaying the current number of visitors in an ASP file:
There are <%response.write(Application("visitors"))%>
online now!
Complete Application object reference manual