title: Back button to be disable after logout
body: <p>I have placed below codeigniter code for controller and view.When a user logout the back button should not go to previous page.But i my case it moves to previous page.Pls help me to solve the issue.</p>
  
  <p>Controller login:</p>
  
  <pre><code>function index()
      {
          $data['main_content'] = 'login_form';
  
          $this-&gt;load-&gt;view('includes/template', $data);    
  
      }
  function logout()
      {
  
           $this-&gt;session-&gt;sess_destroy();
  
          $this-&gt;index();
  
  
      }
  </code></pre>
  
  <p>view:login_form</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
   &lt;SCRIPT type="text/javascript"&gt;
      window.history.forward();
      function disableBack() 
   {
    window.history.forward();
   }
  &lt;/SCRIPT&gt;&lt;/head&gt;
  &lt;title&gt;login_form&lt;/title&gt;
  &lt;BODY onload="disableBack();" onpageshow="if(event.persisted) disableBack();"&gt;&lt;div class="container"&gt;
  
              &lt;div class="row"&gt;
                  &lt;div class="span4 logo"&gt;
                     &lt;img src="&lt;?php echo base_url('img/logosl.png'); ?&gt;"  style="margin-bottom:7px; margin-top:7px;"/&gt;
               &lt;/div&gt;
  
  
  
  
  &lt;?php $this-&gt;load-&gt;view('includes/header'); ?&gt;
  &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url();?&gt;css/style1.css"  /&gt;
  &lt;div id="login_form"&gt;
  
      &lt;h1&gt;Login!&lt;/h1&gt;
      &lt;?php 
      echo form_open('login/validate_credentials');
      echo form_input('username', 'Username');
      echo form_password('password', 'Password');
      echo form_submit('submit', 'Login');
      echo anchor('login/signup', 'Create Account');
      echo form_close();
      ?&gt;
  
  &lt;/div&gt;&lt;!-- end login_form--&gt;
  
  
  &lt;?php $this-&gt;load-&gt;view('includes/footer'); ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>