Forums: How to print session variables on all pages - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to print session variables on all pages

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15882
  • Joined: 03-February 03

Posted 25 September 2014 - 05:22 PM

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 />");
}

Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic