For keeping the "Administration Panel" secure to those who are logged in, for my web application, is the best practice to use an If/Else Statement?
if($_SESSION['logged_in'] == true) {
include '../styles/templates/admincp/header.php';
include '../styles/templates/admincp/content.php';
include '../styles/templates/admincp/footer.php';
}
else {
include '../styles/templates/login.php';
}
Is this how the "professionals' (such as CMS creators, etc) do this authentication style? OR is there a completely better route and method to the If/Else statement to authenticate pages for logged in users to access?