I use this code to verify user authentication on every file. Is it secure or should i add an ELSE after the IF and then close it in the end of the file. I can do that.. but its kind of anoying having to close it in the end all the time.
can i be 100% shure that the redirection is executed? or does this code may in some situation ( which? ) skip the redirection?
<?php
session_start();
if ($_SESSION['estadologado'] != "logado") { header("location:erro.htm"); }
$ID_docente=$_SESSION['ID_docente'];
$username=$_SESSION['username'];
$nome=$_SESSION['nome'];
?>