title: How to update session storage data without refreshing page?
body: <p>I am creating a SPA web application and use SessionStorage to store current user information in my browser. I use Chrome for test.
  in test progress I found that when user login successfully SessionStorage will updated in console but when I cannot access this added value until i refresh the page.</p>
  
  <p>how can I resolve this problem?   </p>
  
  <p>this is my angular service that is responsible for storing and retrieving currentUser in sessionStorage : </p>
  
  <pre><code>app.service("sessionStorageService", ["$window","$q", function ($window, $q) {
  var deferred = $q.defer();
  this.setCurrentUser = function (user) {
      $window.sessionStorage["currentUser"] = JSON.stringify(user);
  },
      this.getCurrentUser = function () {
          if ($window.sessionStorage["currentUser"]) {
              console.log("bega") ;
              deferred.resolve(JSON.parse($window.sessionStorage["currentUser"]));
              return deferred.promise;
          } else {
              console.log("bega1") ;
              deferred.reject("No Login User");
              return deferred.promise ;
          }
      };
  </code></pre>
  
  <p>}]);</p>
  
  <p>this store successfully an same time but for retrieving current user I must refresh the page. and because of spa it is impossible for me :( </p>