Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: sessions.

  1. #1
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sessions.

    Code:
    <%
    dim i
    dim j
    j=Session.Contents.Count
    Response.Write("Session variables: " & j)
    For i=1 to j
      Response.Write(Session.Contents(i) & "<br />")
    Next
    %>
    im in the process of making a shopping cart
    and i am using this code to list all sessions, but it is showing the sessions
    that i am using to list users information.
    (when a user logs in it creates a session to let my pages know they are
    authenticated)

    Is there a way i can exclude certain session names?

    thanks in advance.

    -baleric

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    For Each Item In Session.Contents
       Response.Write Item & ": " & Session.Contents(Item) & "<br>"
    Next

  • #3
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this code still shows all my sessions...
    is there a way i can exclude certain session names...

  • #4
    Registered User
    Join Date
    Jan 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    If you know what ones you want to exlude you could use an if statement...

    For Each Item In Session.Contents
    If Session.Contents(Item) <> "Archangel" Then
    Response.Write Item & ": " & Session.Contents(Item) & "<br>"
    End If
    Next


  •  

    Posting Permissions

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