Why does this `$_SESSION = $_POST` fail?
===

What am I missing here? This is my PHP file:

    <?
    session_start();
    
    echo print_r($_SESSION);
    echo "<br>";
    echo print_r($_POST);
    
    // Save input in session
    $_SESSION = $_POST;
    echo "test1";
    ?>

This file is accessed from a form submit, and I'm sure the post data exists. The output is:

> Array ( [login] => 1 ) 1  
> Array ( [name] => test [type] => test ) 1  
> test2

and it makes no sense to me. The `session` content and `post` content are printed without problems.

But the `$_SESSION = $_POST;` appears to fail, and the rest of the script until the `?>` doesn't give any response, which is obvious because the `test1` text isn't printed.

I can't find out what happens with the `$_SESSION = $_POST;`. All questions I find on SO and elsewhere gives this way to store post data in the session.

I'm aware that `session_start();` is needed prior to any output. Is there something else that is also needed in this case?

What am I missing? 