$USER object in moodle 3.1

$USER object in moodle 3.1

by Ibrahim Fadl -
Number of replies: 1

Dear Support, 

I have moodle 3.1 version and I am trying to echo $USER->email from php and print_object($USER) for a logged in user and the data is different than the one on the user table the user id is the same but the email for example is different. Can I know the $USER object from which table is reading and getting the data? 

Hope to hear from you soon. 

Average of ratings: -
In reply to Ibrahim Fadl

Re: $USER object in moodle 3.1

by Mouhammad Alaa Aldeen Salih -
Hi Ibrahim,

Fetch from {user} table, try logging out and logging in again, because the attributes for the global variable $USER are stored in the SESSION.