if( $_SESSION['user_id'] <> 1)
{
$ref = $_SERVER['HTTP_REFERER'];
header( 'refresh: 5; url='.$ref);
echo $_SESSION['user_id']; // <----- echoes '1'
echo "<h2>Some feature is currently unavailable.</h2>You will be redirected to $ref in 5 seconds"; die;
}
I've written this a hundred different ways and it still redirects even though the user_id accessing the page is '1'.