Have you ever wondered how to list all of your Session and Application variables? Both the Session and
Application objects provide the
Contents collection, which contains all of the session
and application variables that are not objects (i.e., arrays, strings, integers, etc.).
You can loop through this collection using the
For Each ... Next. Since arrays are included
Contents collection, we need to determine if the current variable is an array, using
IsArray function. If the variable is an array, we need to loop through the array one
element at a time, displaying each element. If the variable is not an array, we need to simply
display the variable.
Well, enough chatter, here is the code!
You can list the Application variables by simply changing each instance of the word
in the code above with the word