What is wrong with the session variables

I have no idea whats wrong with the session variables in my code…Here is a snippet:

file 1:

display_test();

    function display_test(){
        if(isset($_SESSION['testing']['testing'])) echo $_SESSION['testing']['testing'];

        echo "<br><br><br><form id="current_juices_form" method="post" action="file2.php">
                <input type="submit" />
             </form>";
    }

File 2(the file the above form is getting submitted too):

testing();

function testing(){
    unset($_SESSION);
    $_SESSION['testing']['testing'] = "<br>testing<br>";
    header("Location:  file1.php");
}

For some reason when redirecting back to file1 after file2 is done processing post action, it’s not printing out the session variable $_SESSION[‘testing’][‘testing’]…what is going on???


Source: forms

Leave a Reply