title: Problem with browser forward and backword button
body: <p>My problem is that when I login my application and store user id in session after that I press browser back button to go again login page and that state (logged in) I check my login page if any user exists then call log out function to log out and same checking when user logged in and press backward then press forward. But both situation my application shows the previous logged in page. </p>
  
  <p>I want that when user login successfully and view the success page that state to press browser back button and reach the login page the user automatically log out and no work to forward button click (disable forward button). </p>
  
  <p>Same works on when user logged in and click to log out link and destroy all session data and reaches to login page that state to click browser forward button no works (disable).Firefox, chrome and IE works well on after log out forward and backward disable and fulfill my wants but Opera, Safari and other browser have problem. Please help me. Here is my code snippet</p>
  
  <pre><code>//Login function
  public function index(){
  
  $data = array();
  
  if( $_SESSION['companyId'] ){
  $this-&gt;logout();
  }
  
  $data['company'] = $this-&gt;Main-&gt;getCompany();               
  echo $this-&gt;load-&gt;view('auth/login', $data);
  }
  
  //login success function
  public function login(){
  
  $data = array();
  
  $username = $this-&gt;input-&gt;post('username');         
  $company_id = $this-&gt;input-&gt;post('company');            
  
  if($_SESSION['companyId']){
      $company_id = $_SESSION['companyId'];
  }
  
  $_SESSION['companyId'] = $company_id;         
  
  $this-&gt;layout-&gt;view('auth/index', $data);               
  }
  
  //Log out function
  public function logout()
  {
  session_destroy();
      redirect(base_url().'index.php/auth/index'); 
  }
  </code></pre>