[This is preliminary documentation and subject to change]
You can create objects with session or application scope in the Global.asa file by using the extended <OBJECT> tag. This tag is self-contained and is outside of any <SCRIPT> tags.
The objects declared in the Global.asa file are not created until the server processes a script that calls that object. This saves resources by creating only the objects that are needed.
<OBJECT RUNAT=Server SCOPE=Scope
ID=Identifier
{PROG|CLASS}>
. . .
</OBJECT>
The first of the following examples creates an object of session
scope named MyConnection by using the ProgID
parameter. The second example uses the ClassID
parameter.
<OBJECT RUNAT=Server SCOPE=Session ID=MyConnection
PROG>
REM Object Script
</OBJECT>
<OBJECT RUNAT=Server SCOPE=Session ID=MyConnection
CLASS>
REM Object Script
</OBJECT>
The objects declared in the Global.asa file can be used by any script in the application. For example, if you declared the following object.
---GLOBAL.ASA---
<OBJECT RUNAT=Server SCOPE=Session ID=MyAd PROG>
</OBJECT>
You could reference the object MyAd from any page
in the application:
---SOME.ASP---
<%= MyAd.GetAdvertisement("/ads/adrot.txt") %>