Posted By

angelpatxi on 03/09/10


Tagged

session application


Versions (?)

Lista de variables de sesion y aplicación


 / Published in: ASP
 

URL: http://www.psacake.com/web/hl.asp

List Session and Application Variables

  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <%
  4. 'How many session variables are there?
  5. Response.Write "There are " & Session.Contents.Count & _
  6. " Session variables<P>"
  7.  
  8. Dim strName, iLoop
  9. 'Use a For Each ... Next to loop through the entire collection
  10. For Each strName in Session.Contents
  11. 'Is this session variable an array?
  12. If IsArray(Session(strName)) then
  13. 'If it is an array, loop through each element one at a time
  14. For iLoop = LBound(Session(strName)) to UBound(Session(strName))
  15. Response.Write strName & "(" & iLoop & ") - " & _
  16. Session(strName)(iLoop) & "<BR>"
  17. Next
  18. Else
  19. 'We aren't dealing with an array, so just display the variable
  20. Response.Write strName & " - " & Session.Contents(strName) & "<BR>"
  21. End If
  22. Next
  23.  
  24. %>

Report this snippet  

You need to login to post a comment.