{
return $cache->get_valor($chave);
}
$cacheArquivo = new CacheArquivo();
$cacheSessao = new CacheSessao();
$Contact = new Contact();
$UsId = $Contact->GetUserIdByUserName($_REQUEST['userName']);
$Contact->UserId($UsId);
$Contacts = $Contact->getAllContacts();
$valor = json_encode($Contacts);
guardar_valor($cacheArquivo, $UsId, $valor);
guardar_valor($cacheSessao, $UsId, $valor);
guardar_valor($cacheSessao, 'USERID', $UsId);
setcookie('USERID', $UsId);
$u->UserName($_REQUEST['userName']);
$u->Password($_REQUEST['password']);
$res = $u->VerifyLogin();
if ($res) {
echo 'Usuário logado!';
echo '<html>';
echo '<br>';
echo '<form action="Main.php">';
echo '<input type="submit" value="Continuar"> </input>';
echo '</form>';
echo '</html>';
} else {
echo 'Usuário e/ou senha não existe(m)!';
echo '<html>';
echo '<br>';
echo '<form action="Login.html">';
echo '<input type="submit" value="Voltar"> </input>';