title: How can i completly destroy session. if session not availbale redirect to login page
body: <p>Hello i am trying to destory session when i press signout button then it's logging out and redirecting to login page; but <code>when click back in browser that page is loading with loign menu on top.</code></p>
  
  <p>And i have wrote a code in everypage as if session not available redirect to login page.</p>
  
  <p>Here is my logout code for session_destroy:</p>
  
  <pre><code>elseif(isset($_GET['type']) &amp;&amp; $_GET['type']== "logout" )
  {
      if (!isset($_SESSION['id'])) {
          header('location:index.php');
          } else {
          session_destroy();
          $_SESSION = array(); 
          header('location:index.php');
      }
  }
  </code></pre>
  
  <p>here is the code what i have mentioned in all pages:</p>
  
  <pre><code>session_start();
  include_once('includes/config.php');
  if(!isset($_SESSION['id'])) {
      header('location:login.php');
  }
  </code></pre>
  
  <p>So my question is completly logout if press back it should not load and has to redirect to login page.</p>