I am protecting my pages by checking the values of my sessions. Is there a more secure way of protecting my pages other than changing the Header Location if the sessions are not valid??? Am I doing anything right???
I have the following at the top of each page:
<?php
session_start();
//VERIFY LOGIN
$validkey = 'br1ll1ant)=&';
if ($_SESSION['valid'] != (hash('sha256',$validkey)) && $_SESSION['tokenconfirm'] != hash('sha256',$_SESSION['tokenID'])) {
header("location:/login/");
};
?>