<%@ Language=VBScript %>
<% Option Explicit %>
<%
'How many session variables are there?
Response.Write "There are " & Session.Contents.Count & _
" Session variables"
Dim strName, iLoop
'Use a For Each ... Next to loop through the entire collection
For Each strName in Session.Contents
'Is this session variable an array?
If IsArray(Session(strName)) then
'If it is an array, loop through each element one at a time
For iLoop = LBound(Session(strName)) to UBound(Session(strName))
Response.Write strName & "(" & iLoop & ") - " & _
Session(strName)(iLoop) & "
"
Next
Else
'We aren't dealing with an array, so just display the variable
Response.Write strName & " - " & Session.Contents(strName) & "
"
End If
Next
%>