Getting custom user attributes in a service, they return NULL I'm building a service where a few user attributes (category fields) are needed and have to be compared against an entry. 

However, when I get the current user and try to load these attributes, they show as NULL. They are filled in at the user's profile, so they shouldn't be NULL.

Below is the code I have used to get try and get the attributes values.

$user = craft()-&gt;userSession-&gt;getUser();
$user-&gt;getContent()-&gt;getAttributes()


Some values are filled out, like the custom field for postal code and phone number. However those category fields are all NULL.
Here's some code that should return categories related to a user:

$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Category);
$criteria-&gt;relatedTo = craft()-&gt;userSession-&gt;getUser();

return craft()-&gt;elements-&gt;findElements($criteria);