solucion parcial bug de cerrar session

This commit is contained in:
humano 2018-07-12 18:37:02 -05:00
parent 6b0df813c1
commit 90d1a4c38f
2 changed files with 42 additions and 2 deletions

View File

@ -22,12 +22,16 @@ function Conectarse(){
exit(); exit();
} }
*/ */
$timestamp =time();
$_SESSION['path']= $path_instalacion; $_SESSION['path']= $path_instalacion;
$_SESSION['path_images_secure']= $path_images_secure; $_SESSION['path_images_secure']= $path_images_secure;
$_SESSION['url']= $url; $_SESSION['url']= $url;
$_SESSION['site']= $site; $_SESSION['site']= $site;
$_SESSION['analizador']= "$codigo_analizador"; $_SESSION['analizador']= "$codigo_analizador";
$_SESSION['upload_size']= $upload_size; $_SESSION['upload_size']= $upload_size;
$_SESSION['timestamp']= $timestamp;
return $link; return $link;
} }
} }
@ -54,12 +58,15 @@ function Conectarse_recursivo(){
exit(); exit();
} }
*/ */
$timestamp =time();
$_SESSION['path']= $path_instalacion; $_SESSION['path']= $path_instalacion;
$_SESSION['path_images_secure']= $path_images_secure; $_SESSION['path_images_secure']= $path_images_secure;
$_SESSION['url']= $url; $_SESSION['url']= $url;
$_SESSION['site']= $site; $_SESSION['site']= $site;
$_SESSION['analizador']= "$codigo_analizador"; $_SESSION['analizador']= "$codigo_analizador";
$_SESSION['upload_size']= $upload_size; $_SESSION['timestamp']= $timestamp;
setcookie("timestamp",$timestamp);
return $link; return $link;
} }
} }

View File

@ -1,3 +1,36 @@
function revisarSession(){
tiempo = "30";
gavela="19";
timestamp = Math.round(Date.now() /1000)
inicio = leerCookie("timestamp");
transcurrido = (timestamp - inicio);
transcurrido_minutos = Math.round(transcurrido/60);
restante = (tiempo - transcurrido_minutos)
prefin = (tiempo*60)-transcurrido
document.form_session.tiempo_session.value = "Cerrar en: "+restante+" minutos ";
if(restante == 1 ){
//alert(transcurrido);
location.href="./includes/salir.php";
}else{
setTimeout("revisarSession()",2000) ;
}
}
function leerCookie(nombre) {
var lista = document.cookie.split(";");
for (i in lista) {
var busca = lista[i].search(nombre);
if (busca > -1) {micookie=lista[i]}
}
var igual = micookie.indexOf("=");
var valor = micookie.substring(igual+1);
return valor;
}
function loadArticle(pageNumber,id,plantilla,registros,scroll) { function loadArticle(pageNumber,id,plantilla,registros,scroll) {
var newDiv = document.createElement('div'); var newDiv = document.createElement('div');