How to view Session Variables in Visual Studio 2008 Debugger?

In VS you can just put 'Session["first_name"]' in the Immediate Window and execute while the code is running. That will return the value that it holds.

If you can't find it go to: View > Other Windows > Command Window, or press Ctrl+W, A

It will look like this: Screenshot:

I know its a bit of a late reply but for anyone else who is interested, I hope this helps!


Isn't it HttpContext.Current.Session("..."), I ask as I haven't used ASP.NET for a long time.


It's pretty simple to inspect the session during debug. Just put a breakpoint in your code and just highlight your Session code (eg. highlight: Session["first_name"]) then right click and select QuickWatch....

This will setup up a watch on your Session for the value you had defined. You can also inspect other Session elements by adjusting the Expression field in the QuickWatch window and clicking the Reevaluate button.