This topic is locked

How to print session variables on all pages

9/25/2014 1:22:12 PM
ASPRunner.NET Tips and tricks
admin

This might be useful for debugging purposes. Add the following code to AfterAppInit event (C#) to do so.

for (int i = 0; i < HttpContext.Current.Session.Count; i++)

{

var crntSession = HttpContext.Current.Session.Keys[i];

HttpContext.Current.Response.Write(string.Concat(crntSession, "=", HttpContext.Current.Session[crntSession]) + "<br />");

}