how to print(output) all session variable

H

hon123456

Dear all,

I am writing ASP page, and I have create many session
variable. Is there exist a function or method to print out ( output )
all the session variable in one page. Because I need to check the value
of all session variable and I cannot scan all the asp page. So I want a
function to print out all the session variable that I have created.
Please help.

Thanks.
 
E

Evertjan.

hon123456 wrote on 17 nov 2005 in microsoft.public.inetserver.asp.general:
I am writing ASP page, and I have create many session
variable. Is there exist a function or method to print out ( output )
all the session variable in one page. Because I need to check the value
of all session variable and I cannot scan all the asp page. So I want a
function to print out all the session variable that I have created.
Please help.

<p>Session Variables: </p>
<% For each d in Session.Contents %>
<%=d%> = <%=Session.Contents(d)%>
<br>
<% Next %>
 
B

Bob Barrows [MVP]

hon123456 said:
Dear all,

I am writing ASP page, and I have create many session
variable. Is there exist a function or method to print out ( output )
all the session variable in one page. Because I need to check the
value of all session variable and I cannot scan all the asp page. So
I want a function to print out all the session variable that I have
created. Please help.

Thanks.

Just use a for each...next loop. At its simplest:

for each key in Session
response.write key & ": " & Session("key") & "<BR>"
next

It gets a little more complicated if you are storing arrays or objects in
session as you have to add checks for IsObject and IsArray into the loop and
handle each accordingly.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top