title: Angular 2 Universal - Store Global Variables
body: <p>I am trying to convert my AngularJS application to Angular 2 Universal application (because of server-side rendering).</p>
  
  <p><a href="https://github.com/angular/universal-starter" rel="nofollow noreferrer">https://github.com/angular/universal-starter</a></p>
  
  <p>Now I need to store global variables which could be achieved easily in normal Angular 2 applications(per below links).</p>
  
  <p><a href="https://stackoverflow.com/questions/37698437/angular-2-global-variable">Angular 2 global variable</a></p>
  
  <p><a href="https://stackoverflow.com/questions/33598153/angular-2-whats-the-best-way-to-store-global-variables-like-authentication-tok">Angular 2 - Whats the best way to store global variables like authentication token so all classes have access to them?</a></p>
  
  <p>One thing you will have to do to achieve this in normal angular 2 App is to pass your global service to bootstrap.</p>
  
  <p>I don't think you can do that in Angular 2 universal app unless I am missing something.</p>
  
  <p>I want to store user data and use it across application. Just like Session data in asp.net. And plus this needs to done without making parent-child components</p>
  
  <p>How can I store global variables in Angular 2 Universal App?</p>
  
  <p>Thanks
  Fahad Mullaji</p>