Page 1 of 1

View All Sessions

Posted: Sat Feb 14, 2004 4:28 pm
by hawleyjr
Is it possible to view all the current session variables?

In the same way you can view the contents of a variable by using:

[syntax=php]echo '<pre>'; print_r($myVar); echo '</pre>';[/syntax]

I would like to do the same but be able to view the session variables?

Posted: Sat Feb 14, 2004 4:38 pm
by DuFF
Yep :D

Code: Select all

<?php
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
?>
Remember that all session values are held in the $_SESSION array. Same goes for $_POST, $_GET, $_SERVER and a few others.

Posted: Sat Feb 14, 2004 4:56 pm
by hawleyjr
Thanks a bunch,

Now that I look at your answer it was foolish of me to ask in the first place...I should have known that....thanks again.

Posted: Sat Feb 14, 2004 5:12 pm
by Cruzado_Mainfrm
you can use the [php_man]print_r[/php_man]() function to dump any kind of arrays, even multi-dimensional arrays(arrays inside arrays :D)