2
I need help with a login script. The problem is that the session is automatically expiring after a certain downtime. I would like to increase the native limit of session of my pages, because the user needs to stay connected to the system all day, and stay logged in when the session expires becomes a nuisance for users. I have tried session_cache_limiter(600);
to increase the limit, however, on the server does not work, the session is destroyed in 2 hours.
My script is basically like this, when logging I create three SESSION
as follows log in.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 in 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 on the pages I want to protect I put at the beginning:
session_start();
include("check.php");
I think your system needs something like "keep connected" that appears in various logins, example facebook. So check out this answer http://answall.com/questions/33664/remin-usu%C3%A1rio-com-seguran%C3%A7a/33684#33684
– marcusagm