Lifetime of Variables A variable declared outside a procedure, can be accessed and changed by any script in the ASP page in which it is declared. A variable declared inside a procedure, is created and destroyed every time the procedure is executed. No scripts outside that specific procedure can access or change that variable. To make a variable accessible to several ASP pages, declare it either as a session variable or as an application variable. Session Variables Session variables store information about one single user, and are available to all pages in one application.
Common information stored in session variables are username and userid.
To create a session variable, store it in a Session Object. Application Variables Application variables are also available to all pages in one application. Application variables are used to hold information about all users in a specific application. To create an application variable, store it in an Application Object. We Help You For Free.