| << 8.1.2- Using Cookies | Chapter8 | 8.2.1- Application Variables >> |
The Application Object
To understand what the Application object is, and what it can do, keep in mind that an application is defined as all the files contained in a virtual directory that has been explicitly configured to be the root of the application, and all of its subdirectories. So, with this object, you can:
- Be notified when an application is first started, so that you can perform some startup processing.
- Be notified when an application is ending, so that you have the opportunity to perform function so that the application closes down cleanly.
- Store information that can be accessed by all clients accessing the application.
There is one instance of the Application object for each application running on the web server, but there may be many clients accessing the same application. They can each get a reference to the same Application object.
An IIS Server can host any number of applications, and each application has its own Application object. This object stores variables and objects for application-scope usage. Application-scope means that variables (and objects) can be accessed from any ASP page that is part of the application. The Application object also holds information about the sessions active within a particular Application.
The diagram that follows shows the relationship between applications, Application objects and Session objects, although the containment of the Session in Application is only at logical level and not specified in any way by the object model.
In the diagram, the applications at the top refer to the collections of web pages and objects defined on the server as virtual directories. The Application objects are the ASP objects that control access to the Application. The Sessions represent individual client sessions with the application – we'll discuss sessions in detail later. For the moment, remember that the first time a client asks for an .asp page belonging to a given application, from your server, a session is established for that client. Any number of sessions can be hosted by any one application, limited only by the memory resources of your server. .
| << 8.1.2- Using Cookies | Chapter8 | 8.2.1- Application Variables >> |

RSS

