title: reactJS logout does not prevent back button from reentering application
body: <p>I have a reactJS application where I provide a bootstrap menu to navigate the application.  In my home page, this is the code of the menu that provides the user the link to log out:</p>
  
  <pre><code>&lt;div className="collapse navbar-collapse" id="navbarSupportedContent"&gt;
      &lt;ul className="nav navbar-nav"&gt;
          &lt;li class="active"&gt;&lt;a href="/preventback"&gt;Logout&lt;/a&gt;&lt;/li&gt;
          &lt;li className="nav-item"&gt;
              &lt;a className="nav-link" onClick={this.accountinformation}&gt;Basic Account Information&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When the user clicks on the Logout link, the application will route to preventback.  This is the code in preventback.js:</p>
  
  <pre><code>import React from 'react';
  
  class preventback extends React.Component {    
  
      componentWillMount() {
          location.href="/logout";
      }
      render() {
          return (  
              &lt;div&gt;     
              &lt;/div&gt;
          );
      }
  }
  
  export default preventback
  </code></pre>
  
  <p>And this is the code in my logout.js:</p>
  
  <pre><code>import React from 'react';
  import '../styles/app.css';
  
  class logout extends React.Component {    
  
  render() {
  
          return (  
              &lt;div className="App"&gt;      
                  &lt;nav className="navbar navbar-expand-lg navbar-light bg-light"&gt;
                      &lt;a className="navbar-brand" href="#"&gt;&amp;nbsp;&lt;/a&gt;
                  &lt;/nav&gt;
                      &lt;div className="container"&gt;
                          &lt;div className="row"&gt;
                              &lt;div className="col-12 text-center"&gt;
                                      &lt;p className="h4"&gt;You have been logged out&lt;/p&gt;
                                      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
                                      &lt;div className="text-center py-4 mt-3"&gt;
                                          &lt;button type="button" className="btn btn-primary"
                                              onClick={() =&gt; { 
                                              location.href = ('/') 
                                              }}&gt;
                                              Log In
                                          &lt;/button&gt;
                                      &lt;/div&gt;  
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
              &lt;/div&gt;
          );
      }
  }
  
  export default logout
  </code></pre>
  
  <p>All this code works as expected.  When I click on the logout link, I get directed to preventback and then preventback directs me to logout.  </p>
  
  <p>My issue is that when I click on the browser back button, the browser takes me from the logout page to my home page.  I had anticipated it taking me from the logout page to the preventback page.  Then, when the preventback page loads, it would automatically route back to the logout page.  </p>
  
  <p>What am I not understanding?</p>
  
  <p>Thanks.</p>