title: wp_get_current_user behavior seems to have changed when using outside normal loop
body: <p>Previously was experimenting with creating a php file included in the footer as a javascript via : </p>
  
  <pre><code>header('Content-type: application/javascript');
  </code></pre>
  
  <p>One of my goals was to do check if the user has a certain capability before rendering out this particular javascript file.</p>
  
  <p>It was working...till a day or 2 ago...thinking it has to do with the recent wordpress update.</p>
  
  <p>Previously I was attempting the following:</p>
  
  <pre><code>include('../../../wp-load.php');
  
  if(current_user_can('administrator')) {
      //print out some javascript stuff
  }
  </code></pre>
  
  <p>However now it doesn't work. And when attempting to see what the current user is via:</p>
  
  <pre><code>wp_get_current_user();
  </code></pre>
  
  <p>It is just an empty object.</p>
  
  <p>Wondering if anybody has a clue to what was changed, and what I am missing to get this working again.</p>
  
  <p>Thank you.</p>