Testing Session Variables

Conclusion: Interrogating and displaying SESSION variables does not destroy them.

Display Session One Directly

$_SESSION['One'] = Test One

Display Session Two via a Variable ($v_two)

$v_two = Test Two

Now print all variables using Print_r ($_SESSION)

Array ( [s_rp] => http://www.mentalshots.com/_tests/test_urlencode_variables.php [s_rt] => The title has an apostrophe's, 2 \slashes\, an @ sign, a plus +, a tildy ~, "double quotes" and an & ampersand in it. [s_rp2] => http%3A%2F%2Fwww.mentalshots.com%2F_tests%2Ftest_urlencode_variables.php [s_rt2] => The+title+has+an+apostrophe%27s%2C+2++%5Cslashes%5C%2C+an+%40+sign%2C+a+plus+%2B%2C+a+tildy+%7E%2C+%22double+quotes%22+and+an+%26+ampersand+in+it. [s_rp3] => http%3A%2F%2Fwww.mentalshots.com%2F_tests%2Ftest_urlencode_variables.php [s_rt3] => The+title+has+an+apostrophe%26%23039%3Bs%2C+2++%5Cslashes%5C%2C+an+%40+sign%2C+a+plus+%2B%2C+a+tildy+%7E%2C+%26quot%3Bdouble+quotes%26quot%3B+and+an+%26amp%3B+ampersand+in+it. [One] => Test One [Two] => Test Two [Three] => Test Three [Four] => Test Four )

Now go to test_session_variables2.php to see what variables are available.

Return to Test Directory Home Page