Porque no me redirige este código, cuando escribo la pagina en el navegador aparece en blanco pero no cambia a index.php.
Código PHP:
Ver original<?php
if(isset ($_SESSION['usuario'])) { header('Location: ../index.php'); }
elseif (isset ($_SESSION['contrasena'] )) { header('Location: ../index.php'); }
else {
$enlace[1]="inicio1.php";
$enlace[2]="inicio2.php";
$enlace[3]="inicio3.php";
$total_enlaces=1;
while ( !empty($enlace[$total_enlaces+1]) ) { $total_enlaces++;
}
$aleatorio=rand(1,$total_enlaces);
/*echo '
<html>
<head>
<meta http-equiv="refresh" content="0;url=... '.$enlace[$aleatorio].'">
</head>
</html>
';*/
}
?>
Si a ese código agrego un cierre de sesión por tiempo tampoco lo cierra
Código PHP:
Ver original<?php
$inactivo = 600;
if (isset($_SESSION["timeout"])) { $tiempoSession = time() - $_SESSION["timeout"]; if ($tiempoSession > $inactivo) {
header("Location: ../index.php"); }
}
$_SESSION["timeout"] = time(); ?>
Es correcto este cierre de cookies
Código PHP:
Ver original<?php
if (ini_get("session.use_cookies")) {
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]);
}
?>