Using header(location: ......php) within a class not working



Hi.

Can someone tell me why this code is not working?

<?php
session_start();
class tta_globals {

function check_session_state(){
if(!$_SESSION['logged_in']){
header('Location: login.php');
die();
}
}
}

$tta_globals = new tta_globals();

$tta_globals -> check_session_state();
?>

When I run this code it doesn't redirect the user? I have checked and
double checked to make sure that there is no session['logged_in']
anywhere.

Can anyone help?

Regards,
Alex.
Ajtrichards Web Solutions
http://www.ajtrichards.co.uk

.