<?php 
$url = urlencode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); //header('location:../login/?url='.$url.''); 
//if(isset($_SESSION['j_admin']) || isset($_SESSION['j_admin'])){
if(isset($_SESSION['j_admin'])){
    $time_out = $_SESSION['j_timeout'];
    $minutes = ( time() - strtotime("$time_out")) / 60;
    if($minutes > 20){
        //session_destroy();
        //header('location: '.$dir.'login/?url='.$url.'');
    }else{
        $_SESSION['j_timeout'] = $CurrentDate;
    }
}
?>