Using the Verastream SDK with Active Server Pages
You can use Attachmate Verastream SDK for Unisys and Airlines objects in Microsoft Active Server Pages (ASP) on any Web server that supports ASP.
Following are some basic guidelines on using SDK objects with ASP:
- Include a Global.asa file in the virtual directory of an Attachmate Verastream SDK for Unisys and Airlines application. The Global.asa file is a file maintained on a Microsoft Internet Information Server (IIS) for the application. This file is processed automatically by the server when:
- The application starts and stops
- Individual users start and stop browser sessions that access the application's Web pages
The Global.asa file typically contains scripts to declare objects, initialize application or session variables, connect to databases, send cookies, initialize and terminate sessions or applications, and perform other operations that pertain to the application as a whole.
||A Global.asa file may be created for you automatically, depending on the development tool you are using.
- Use the ASP intrinsic Session object to store user session variables. This object is responsible (on the Web server) for equating requests from a specific client. (The ASP Session object is in no way related to the Attachmate host Session object, AtmSession.)
||It is possible that
set object=nothing may be ignored by IIS and the object placed in an "instant ready" pool to be used by the next server.createobject request.
Another issue to be aware of is threading. Once a session-level ASP object is created, it is attached to a specific, discrete thread. That thread cannot be destroyed until all users assigned to that thread either
%session.abandon% or their ASP session times out. Objects created with a session scope (for example,
set session("whatever")=server.creatobject("whatever.id")) do not scale well and are affected by the threading issues in the following way:
- When an ASP session terminates, use the Session_OnEnd event procedure to disconnect the Attachmate Session object and to remove references to all Attachmate Verastream SDK for Unisys and Airlines objects that have been created. For example:
if IsObject(screenObj) then
screenObj = Nothing
- Setting IIS Options for Your Application:
Following are several options that you must set within IIS. The examples shown are from IIS 5.1.
- The directory in which you store your ASP application must have at least Scripts Only permission (for the Execute Permissions option) enabled. To set this, right click the folder in which your ASP application resides and set the options as shown in Properties dialog box, shown below:
- You must also enable session state for the application. To do so, click Configuration on the Properties dialog box (shown above). Then, on the Application Configuration dialog box, select Enable Session State, as shown below:
When session state is enabled, Active Server Pages creates a session for each user who accesses the ASP application so that you can identify the user across pages in the application. If you do not enable this option, ASP does not track users and does not allow an ASP script to store information in the Session or Application object, or use the Session_OnStart or Session_OnEnd events.
- An ASP session automatically ends if the user has not requested or refreshed a page in an application by the end of the timeout period (the default period is 20 minutes). It is recommended that you enter a value of 5 (minutes) for the Session Timeout. Limiting the session timeout value can be important because an SDK object is not automatically freed from memory when a user closes a client application (browser); it is only freed when the timeout value is reached.
To change the timeout period, enter the new value in the Session Timeout text box on the App Options tab of the Application Configuration dialog box (shown above), or specify the timeout period within a script using the Session.Timeout parameter. A script can also explicitly end a session by using the Session.Abandon method. Even when session state is enabled for an application, you can disable session state for an individual ASP page by using the