title: How to properly clear history in ionic?
body: <p>So I am testing my app via browser (chrome), and I have problems clearing old views/cache. So this is the part where I sign out of my app:</p>
  
  <p><a href="https://i.stack.imgur.com/EGgRx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EGgRx.png" alt="enter image description here"></a></p>
  
  <p>As you can see, when I click Log out, this is the code firing:</p>
  
  <pre><code>   Auth.$signOut().then(function(){
          $ionicHistory.nextViewOptions({
                  disableBack: true,
                  historyRoot: true
          });
          $ionicHistory.clearHistory();
          $ionicHistory.clearCache();
          $state.go('login');
     });
  </code></pre>
  
  <p>This works though when I try to login again in my login page, this is what fires:</p>
  
  <pre><code>$ionicHistory.nextViewOptions({
    disableBack: true
  });
  $ionicHistory.clearHistory();
  $ionicHistory.clearCache();
  $state.go("menu.myReports");
  </code></pre>
  
  <p>It also works but I still see this same view before I logged out:</p>
  
  <p><a href="https://i.stack.imgur.com/VtdeW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VtdeW.png" alt="enter image description here"></a></p>
  
  <p>Instead of just:</p>
  
  <p><a href="https://i.stack.imgur.com/RxTSf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RxTSf.png" alt="enter image description here"></a></p>
  
  <p>I want to clear every history, cache or whatever whenever I sign out. Is that even possible? I'm using <code>AngularFire</code> for my database.</p>