Home | Advertising Info65 USERS CURRENTLY ONLINE   
   Site Search Contact Us Monday, October 20, 2014  
 
 







DISCUSSION ARCHIVES
DISCUSSION ARCHIVES 2
DISCUSSION ARCHIVES 3
BLOG

 
Try a free httpZip trial now and compress for less!


We didn't realize
the site was so popular.

Other Stuff
 
 


Displaying all Session and Application Variables




Often when using ASP or Active Server Pages you will find it necessary to do some troubleshooting. Below is some neat code you can run that will show you all the current Session and Application variables and really give you a good idea of what sort of information is being saved in them. At the bottom of this page we also show you a way to erase/clear all this information all at once.

<font face=arial size=1>
Session Variables - <% =Session.Contents.Count %> Found<br><br>
<%
Dim item, itemloop
For Each item in Session.Contents
  If IsArray(Session(item)) then
    For itemloop = LBound(Session(item)) to UBound(Session(item))
%>

<% =item %>  <% =itemloop %> <font color=blue><% =Session(item)(itemloop) %></font><BR>
<%
    Next
  Else
%>
<% =item %>
<font color=blue><% =Session.Contents(item) %></font><BR>
<%
  End If
Next
%>


<hr>

Application Variables - <% =Application.Contents.Count %> Found<br><br>
<%
For Each item in Application.Contents
  If IsArray(Application(item)) then
    For itemloop = LBound(Application(item)) to UBound(Application(item))
%>

<% =item %>   <% =itemloop %> <font color=blue><% =Application(item)(itemloop) %></font><BR>
<%
    Next
  Else
%>
<% =item %>
<font color=blue><% =Application.Contents(item) %></font><BR>
<%
  End If
Next
%>

</font>





Additionally, here is some handy code you can run that will wipe that information clean.

<%
Session.Abandon
Application.Contents.RemoveAll()
%>

 

 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2014 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com