I have the following code:
    Auth->user())
    {
        echo $this->element(\'header\');
    }
    else
    {
        e         
        
You need to set the user details from a controller, preferably the AppController which is inherited by all controllers across your site. Create/amend your app_controller.php to contain this beforeFilter(); method.
Auth->user();
    $this->set(compact('user'));
}
This will set a var called $user to the views which will be empty if the user is not logged in, or contain their data if they are.