How do can I get a field from the current user in an entry point?

Greetings,

I added a custom field to the Users and through research I found out that I can get that field by using something like:

<?php
global $current_user;
$fieldData = $current_user->my_field_c;

I tested this out on my local instance and it worked fine but when I installed the module in a online instance $fieldData always stays blank. Anyone knows the cause of the problem?

Thanks in advance,

André Policarpo