title: Angularjs session handling
body: <p>I am using angularjs for building a admin side page of one of my application.Data is fetched using webservices. 
  At the time of login am using session to store values get from login api. Values are stored in <code>$localstorage.token</code> and <code>$#localstorage.currentUser</code>
  And <code>$localstorage.current</code> user is used in home page to display user details. The thing is details are displayed only after refreshing the entire page after logged into that account. Is there any solution to get the data without manually refreshing the page.</p>
  
  <p>In my index page,</p>
  
  <pre><code>          &lt;ul class="dropdown-menu dropdown-menu-right"&gt;
                &lt;li class="dropdown-header"&gt;
                  {{currentUserDetails.user.full_name}}
                &lt;/li&gt;
                &lt;li class="divider"&gt;&lt;/li&gt;
                &lt;li class="link"&gt;
                  &lt;a href="#"&gt;
                    Profile
                  &lt;/a&gt;
                &lt;/li&gt;
  
                &lt;li class="divider"&gt;&lt;/li&gt;
                &lt;li class="link"&gt;
                  &lt;a href="" ng-click="logout()"&gt;
                    Logout
                  &lt;/a&gt;
                &lt;/li&gt;
              &lt;/ul&gt;
  </code></pre>
  
  <p>In my Controller</p>
  
  <pre><code>         if(response){
                 $localStorage.LoggedInuser = response;
                // $window.location.reload();
                 $state.go('index');
  
              }else{
                  $scope.error_message = "Invalid username or password.";
              }   
  </code></pre>
  
  <p>Thnaks in advance</p>