CashMan H.A. uses native PHP sessions as its sole authentication state mechanism. Every request that entersDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DanielRivera03/SistemaBancario/llms.txt
Use this file to discover all available pages before exploring further.
controlador/cGestionesCashman.php must carry a valid session populated at login — there are no tokens or external session stores. Each protected route individually inspects $_SESSION['id_rol'] before serving any content, ensuring that a user who guesses or crafts a URL for a different role is immediately bounced to the system redirect page.
Session Variables
The following variables are written to$_SESSION immediately after IniciarSesionUsuarios() returns a successful result. They remain active for the entire authenticated session.
| Session Key | Type | Description |
|---|---|---|
$_SESSION['id_usuario'] | int | Unique user ID |
$_SESSION['nombre_usuario'] | string | First name |
$_SESSION['apellido_usuario'] | string | Last name |
$_SESSION['usuario_unico'] | string | Unique username / account code |
$_SESSION['id_rol'] | int | Role ID (1–5) |
$_SESSION['correo_usuario'] | string | Email address |
$_SESSION['foto_perfil'] | string | Profile photo filename |
$_SESSION['estado_usuario'] | string | Account status (activo / inactivo / bloqueado) |
$_SESSION['comprobar_iniciosesion_primeravez'] | string | First-login flag — marks whether this is the user’s first session |
$_SESSION['habilitar_sistema'] | string | Credit/system access flag — controls whether a client’s credit has been approved |
$_SESSION['comprobacioncuenta_ahorros'] | string | Savings account existence flag |
$_SESSION['comprobacioncreditos_clientes'] | string | Active credit existence flag |
Role Guard Pattern
Every route case insidecGestionesCashman.php wraps its logic in a strict role check against $_SESSION['id_rol']. If the session role does not match the required value, the request is unconditionally redirected to the system redirect page — no content is rendered and no queries are executed.
?cashmanhagestion=redirecciones-sistema-cashmanha serves a generic “access denied” page and does not expose which resource was requested.
Logout
The logout route is?cashmanha=cerrarsesion in cIniciosSesionesUsuarios.php. It calls session_unset() to clear all session variables, then session_destroy() to invalidate the session ID on the server, and finally redirects to the login page:
Session Expiration for Password Recovery
During the password recovery flow, two additional session keys track the time window for code validity:$_SESSION['expirar_sesion']$_SESSION['tiempo_sesion']
unset() before session_unset() / session_destroy() — on any route that terminates the recovery flow: ?cashmanha=expiracion-cambio-contrasenia, ?cashmanha=confirmacion-cambio-contrasenia, and ?cashmanha=error-cambio-contrasenia. This prevents stale timer state from persisting if a user starts a new recovery flow without completing the previous one.