How can I list all my session variables?

Discussion in 'ASP General' started by michaaal, Jan 31, 2004.

  1. michaaal

    michaaal Guest

    I would like to be able to list the names of all of my session variables.
    Maybe something like this...

    <%
    response.write(AllSessionVariableNames)
    %>

    Can this be done??
    michaaal, Jan 31, 2004
    #1
    1. Advertising

  2. michaaal

    Ray at Guest

    You can do something like:

    <%
    for each x in session.contents
    response.write x & " = " & session.contents(x) & "<br>"
    next
    %>

    --

    Ray at home
    Microsoft ASP MVP


    "michaaal" <> wrote in message
    news:...
    > I would like to be able to list the names of all of my session variables.
    > Maybe something like this...
    >
    > <%
    > response.write(AllSessionVariableNames)
    > %>
    >
    > Can this be done??
    >
    >
    Ray at, Jan 31, 2004
    #2
    1. Advertising

  3. michaaal

    Rob Greene Guest

    This will get those unknown items from the session variables
    -rwg

    <%
    for each itm in session.contents
    response.write( "<br>" & itm & " = " & session.contents(itm) )
    next
    %>
    Rob Greene, Feb 1, 2004
    #3
  4. michaaal

    Tony T Guest

    Dim j As Integer =
    For j = 0 To Session.Contents.Count -
    Response.Write(CType(Session.Keys(j), String) & "=" & CType(Session.Contents(j), String) & "<br>"
    Next
    Tony T, Apr 23, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    445
    Natty Gur
    Jul 16, 2003
  2. fadi
    Replies:
    1
    Views:
    945
    Mark MacRae
    Jul 21, 2003
  3. Mark MacRae
    Replies:
    1
    Views:
    428
  4. Replies:
    9
    Views:
    914
  5. Jazzis
    Replies:
    2
    Views:
    227
    Jazzis
    Sep 23, 2003
Loading...

Share This Page