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

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -