Listing Session and Application Variables question

Results 1 to 2 of 2

Thread: Listing Session and Application Variables question

  1. #1
    WZJN Guest

    Default Listing Session and Application Variables question

    I&#039m still having a difficult time trying to run this seemingly little script and am wondering what I&#039m might be doing incorrectly. <BR><BR>I grabbed the code - Listing Session and Application Variables - (as is) from the front page on this site, and the article is from 10/09.<BR><BR>The error I&#039m getting is:<BR>Microsift VBScript runtime error &#039 800a01b6&#039<BR>Object doesn&#039t support this property or method: &#039Session.Contents&#039<BR>/path/pathscript.asp line 6<BR><BR>How could the object *not* support the property or method? I&#039m confused! As I say, this is line for line a cut/paste.<BR><BR>Here is the code anyway --<BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR>&#060;%<BR><BR>&#039How many session variables are there?<BR>Response.Write "There are " & Session.Contents.Count & " Session variables&#060;P&#062;"<BR><BR>Dim strName, iLoop<BR>&#039Use a For Each ... Next to loop through the entire collection<BR>For Each strName in Session.Contents<BR>&#039Is this session variable an array?<BR>If IsArray(Session(strName)) then<BR>&#039If it is an array, loop through each element one at a time<BR>For iLoop = LBound(Session(strName)) to UBound(Session(strName))<BR>Response.Write strName & "(" & iLoop & ") - " & _<BR>Session(strName)(iLoop) & ""<BR>Next<BR>Else<BR>&#039We aren&#039t dealing with an array, so just display the variable<BR>Response.Write strName & " - " & Session.Contents(strName) & ""<BR>End If<BR>Next<BR>%&#062;<BR><BR>I did receive an earlier response (thank you!) that said "I tried the code using PWS on Win 98 and it worked OK. I&#039m not sure what the problem could be." This leads me to believe that I&#039m ... I dunno ... missing a piece?<BR><BR>Do I need to be an admin or something to run this? Am I to put it in a certain directory? Do I need to leave this program somewhere and access it via another page? So I can advance my asp knowledge, can anyone give me a clue as to what on earth I may be doing wrong here ?<BR><BR>Thanks so much!<BR><BR>WZJN

  2. #2 Guest

    Default RE: Listing Session and Application Variables ques

    I think I was the person who spurred that article - since I asked the site owner about that the same day . . . here is what I used to dump all Application variables - this is the entire code I used - ditch all that other stuff, to be sure this works on you machine first!<BR><BR>For Each strName in Application.Contents<BR> Response.Write strName & " - " & Application(strName) & "<BR>"<BR>Next<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts