Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > how to print(output) all session variable

Reply
Thread Tools

how to print(output) all session variable

 
 
hon123456
Guest
Posts: n/a
 
      11-17-2005
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.

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-17-2005
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 %>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-17-2005
hon123456 wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
hon123456
Guest
Posts: n/a
 
      11-17-2005
Thanks very much for your help
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 %>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)


 
Reply With Quote
 
Kyle Peterson
Guest
Posts: n/a
 
      12-04-2005

http://www.powerasp.com/content/new/...-variables.asp



"hon123456" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
System Session Variable VS. Own-declared 'Session' Variable chowchho ASP .Net 7 03-28-2008 02:38 PM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM



Advertisments