xProteuSx Posted October 19, 2011 Share Posted October 19, 2011 I am building a website that uses session variables extensively. The site is getting a little complicated, and I am starting to lose track of which session variables are assigned, and what their values are. Is there some way where I can create a piece of code that will display all of the existing session variables and their values? Quote Link to comment https://forums.phpfreaks.com/topic/249377-display-all-session-variable-names-and-values/ Share on other sites More sharing options...
voip03 Posted October 19, 2011 Share Posted October 19, 2011 <?php session_start(); echo "<h3> PHP List All Session Variables</h3>"; foreach ($_SESSION as $key=>$val) echo $key." ".$val."<br/>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/249377-display-all-session-variable-names-and-values/#findComment-1280450 Share on other sites More sharing options...
xProteuSx Posted October 19, 2011 Author Share Posted October 19, 2011 Phenomenal. Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/249377-display-all-session-variable-names-and-values/#findComment-1280452 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.