<?php
    if(isset($_SESSION['logged_in']))
    {
            header('Location: test.php');
echo "test";
    ?>
    <?php
    }
    else
    {
    ?>
            <a href="#" onclick="CallAfterLogin();"><img src="facebook-login-button.png" border="0" alt="Log in with Facebook"></a>
    <?php } ?>
After the user is login, I visit back to this file, and it just won't redirect. It did appear the echo but not the redirect, I wonder.
 
     
    