session_cache_expire(10); //tempo de sessão igual 10 minutos
session_start();
if($logado){
$_SESSION[“donoSessao”] = md5('seg'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);
}
//a cada nova página adicione o trecho abaixo
$tokenUser = md5('seg'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);
if($_SESSION[“donoSessao”] != $tokenUser){
header(‘location:login.php’);
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.