We can create a function:
function autenticar($id, $password){
global $datos;
if (!array_key_exists($id, $datos)){
return false;
}
return password_verify($password, $datos[$id]['clave']);
}
Too a cookie and date in gmdate:
setcookie('jwt', $jwt, time() + 2 * 60 * 60, '/');
$_SESSION['inicio'] = gmdate('M d Y H:i:s', time());