the following code is preventing the header() function from redirecting the page:
echo "Starting to output current session data";
print_r($HTTP_SESSION_VARS);
if you where to add this code at line 1 to turn error reporting on:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
you would see that there is Headers Already Sent error occurring.
the headers already sent error occurs if there is any output to the page before the session-start() or header() functions are called. you code:
the following code is preventing the header() function from redirecting the page:
echo "Starting to output current session data";
print_r($HTTP_SESSION_VARS);
is causing the output to the page, which is preventing the header() function from executing.