If ur Authenticating ur user by user name and password then u can use a another way.
When some user Authenticate then create session value like this
<?
$_SESSION["type"]="login";
?>
and all ur PHP pages in start use this script
<?
session_start()
$type=$_SESSION["type"];
if ($type!="login")
{
header("location: www.yourdomain.com/login.php");
}
?>
so no body can access ur page.... with out login..