Would this be kinda what I need?
login.php
<?php
//f_login save a session with user and pass
$login = f_login($_REQUEST['usuario'],$_REQUEST['clave']);
//f_login return a encrypted value
if($login)
{
$_SESSION['login_enc']=$login;
}else{
//incorrect user or password.
}
?>
protected.php
<?php
//Protected page
//check
//1 CHECK. user and password
//return encrypted session
$enc_user = f_encuser($_SESSION['usuario'], $_SESSION['clave']);
//2 CHECK the last encrypted login and compare
if($_SESSION['login_enc']==$enc_user){
// correct
}else{
// incorrect
}
?>