Listing Session and Application Variables

Results 1 to 2 of 2

Thread: Listing Session and Application Variables

  1. #1
    WZJN Guest

    Default Listing Session and Application Variables

    I&#039m having a heck&#039a&#039va time trying to run this seemingly little script and am wondering what I&#039m might be doing incorrectly. 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>"<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>"<BR> End If<BR> Next<BR><BR>%&#062;<BR><BR>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
    Join Date
    Dec 1969
    Posts
    940

    Default RE: Listing Session and Application Variables

    I tried the code using PWS on Win 98 and it worked OK. I&#039m not sure what the problem could be.

Posting Permissions

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