How to browse all session variables in debug mode?

Baxter picture Baxter · Aug 15, 2012 · Viewed 8.6k times · Source

I am using Microsoft Visual Studio 2010 Professional and developing an asp.net / C# app. While in debug mode I can see the local variables under the "Locals" tab, and there is also something called "this" which expands into multiple tree structures. However, I am unable to find my Session variables name / value pair anywhere.

A friend suggested I use the "Immediate Window" tab and type the name of my Session variable (ie.,Session["SomeValue"] and press enter. This does give me the value of the Session variable. This is simple enough for a single session variable but when dealing with multiple variables it becomes a bit cumbersome.

Is there anyway that I can just browse to a section that stores the key / value pair for all my session variables, like I can for the local variables?

Answer

Jec picture Jec · Aug 15, 2012

Maybe you can try using Watch Windows. Type

httpContext.Session["your session variable name"]