html - Is it safe to only redirect non logged users on php? -
i'm creating little website , i'm wondering since had lessons on http headers if it's safe use such logging algorithm :
if(! isset($_session["user"]) { header("location : logout.php"); } // , here start web page if conditin above not satisfied <html> ........
i think it's not because redirection can ignored web client isn't ?
its better add 'else' statement prevent bugs trolling :)
if(!isset($_session["user"]) { header("location : logout.php"); exit("you not authorized!"); } else { ?> <html>...</html> <?php } ?>
Comments
Post a Comment