S_SESSION variable (user role) not recognised

Session login and start, with Session variables declaration and store:

session_start();
$_SESSION['estado'] = "activo";
$_SESSION['usuario'] = $usuario;
$_SESSION['us_type'] = $registro['us_type'];
$_SESSION['us_avatar'] = $registro['us_avatar'];
header('location:/gestion/panel.php');

Variable $_SESSION['estado'] works fine as it loads content if it is activo, and if not locates to other directory:

if(($_SESSION['estado'] == 'activo')){
   ....

But it does not seem to recognise $_SESSION['us_type'], as even when Database has correct fieldname and value *(us_type, 1)* php does not load under this conditional, locating user as if it had no value 1 on us_type:

 if(($_SESSION['estado'] == 'activo') && ($_SESSION['us_type']== 1)){
   ....

Why is the reason for this? Even when status session variable is working fine..

edit: $_SESSION value: Array ( [estado] => activo [usuario] => german [us_type] => [us_avatar] => )

Leave a Comment