I need help with a login script. The problem is that the session automatically expires after a certain downtime. I'd like to increase the native session limit of my pages because the user needs to stay logged in on the system all day, and logging in when the session expires becomes a nuisance for users. I have tried session_cache_limiter(600);
to increase the limit, but the server does not work, the session is destroyed in 2 hours.
My script is basically like this, when I log in I create three SESSION
as follows logar.php :
$_SESSION['cod_cliente'] = ($row["cod_cliente"]);
$_SESSION['op'] = ($row["usuario_id"]);
$_SESSION['op_tipo'] = md5($row["tipo"]); //perfil
I have a page that checks if the user is logged check.php :
if(!isset($_SESSION['cod_cliente']) && empty($_SESSION['cod_cliente']) || !isset($_SESSION['op']) || empty($_SESSION['op']) || !isset($_SESSION['op_tipo']) || empty($_SESSION['op_tipo']))
{
session_unset();
session_destroy();
header('Location:login.php');
}
And in the pages that I want to protect I put in the beginning:
session_start();
include("check.php");