title: Global Variable in Ember.js with local storage
body: <p>I've got a problem that has driven me round in circles, and I'd like to know the correct solution. It's likely that something fundamental and obvious hasn't clicked in my head, but as I'm knew to Ember.js I'd appreciate your time.</p>
  
  <p>I'd like to use a global variable in ember.js to store a users id and name.</p>
  
  <p>At the moment, I've done this by adding variables to application controller:</p>
  
  <pre><code>App.ApplicationController = Ember.Controller.extend({
      //user name initially set to Tom
      name:'Tom',
      //using local storage - only works in modern browsers
      userID: localStorage['userID']
  });
  </code></pre>
  
  <p>Question 1: In the application template, I can display the "name" variable by using {{name}}. Fine. 
  I also have a 'login' template, how do I access the "name" variable from the login template?
  I've tried using {{App.name}} but this doesn't work? 
  Do I have to pass the application controller variables to the login controller and if so, do I do this from the login router?</p>
  
  <p>Question 2: To set the userID from the login controller, is it a case of using:</p>
  
  <pre><code>this.controllerFor('application').set('userID','Fred');
  </code></pre>
  
  <p>or should I be using:</p>
  
  <pre><code> Ember.set('App.userID','Fred');
  </code></pre>
  
  <p>OR, should I be creating a separate user controller or perhaps user object to store this data?</p>