Without having to call each session variable by name, is there a way to display the content of all the session variables currently set?
Without having to call each session variable by name, is there a way to display the content of all the session variables currently set?
session_start();
echo '<pre>';var_dump($_SESSION);echo '</pre>';
// or
echo '<pre>';print_r($_SESSION);echo '</pre>';
NOTE: session_start(); line is must then only you will able to print the value $_SESSION
Echo the session object as json. I like json because I have a browser extension that nicely formats json.
session_start();
echo json_encode($_SESSION);