title: How to keep track of user data
body: <p>What is the best way in OOP, SESSIONS, and User Accounts to keep track of user information to use throughout a website. (ex. Stack Overflow, Facebook, Google, YouTube, etc.) </p>
  
  <p>I was thinking that once a user logs in you could assign all the information to the session array. For an example:</p>
  
  <blockquote>
    <p>$_SESSION['user_id'], $_SESSION['roles']. </p>
  </blockquote>
  
  <p>Then in OOP you could do:</p>
  
  <blockquote>
    <p>$foo->getUserId(), $foo->getAge($user_id), etc.</p>
  </blockquote>
  
  <p>I guess my question is what is the best way to handle information to use for dynamic content across a webpage that is based on the user? (ex. User Profile, Age, Join Date, etc.). Should I only store a SESSION variable of the user_id, then use the user_id to fetch the information I want?</p>