title: List all session variables including nested nodes
body: <p>I am having a terrible time, I know how to do this in 6 other languages, but cannot get this to work</p>
  
  <p>I want to see all session variables in a .NET application, INCLUDING nested nodes</p>
  
  <p>I used the code from here <a href="https://stackoverflow.com/questions/2584392/list-all-session-info">List all session info</a></p>
  
  <p>and I am able to get the first level of all session variables using</p>
  
  <pre><code>&lt;% 
  for (int i = 0; i &lt; Session.Count; i++)
  {
      var crntSession = Session.Keys[i];
      Response.Write(string.Concat(crntSession, "=", Session[crntSession]) + "&lt;br /&gt;");
  }
  %&gt;
  </code></pre>
  
  <p>here is a portion of my output</p>
  
  <pre><code>Mode=M
  TreeRefresh=
  AdvUser=TheName.WebFramework.Security.AdvanceUser
  </code></pre>
  
  <p>How can i iterate through AdvUser and get its values as well?</p>
  
  <p>I have tried this, but it returns an error  CS1061: 'object' does not contain a definition for 'Count' </p>
  
  <pre><code>for (int i = 0; i &lt; Session["AdvUser"].Count; i++)
  </code></pre>
  
  <p>I also tried this and got the error </p>
  
  <blockquote>
    <p>CS1579: foreach statement cannot operate on variables of type
    'System.Type' because 'System.Type' does not contain a public
    definition for 'GetEnumerator'</p>
  </blockquote>
  
  <pre><code>foreach (var crntSession in Session["AdvUser"].GetType())
  </code></pre>
  
  <p>i just don't know how to get to that nested node's values, it doesnt have to be in C# can be in VB</p>