title: How to destroy session on clicking back button of browser using jquery
body: <p>After login, if i click back button of browser then i want to destroy session by directing it to a php page using jquery.</p>
  
  <p>Here is my jquery code which is working fine for mozilla. but not working on chrome.i want browser independent .</p>
  
  <p>Thanks in advance. </p>
  
  <pre><code>          &lt;script&gt;
                $(document).ready(function(){ 
                    if (typeof history.pushState === "function") {
                           history.pushState("bbs", null, null);
                           window.onpopstate = function () {
                           history.pushState('newbbs', null, null);
                     };
                 $(location).attr('href','backbuttonsessiondeactivation.php');
                 }
  
             });       
           &lt;/script&gt;
  </code></pre>
  
  <p>Here is my backbuttonsessiondeactivation.php content:</p>
  
  <pre><code>                 &lt;?php
                      session_start();
                      extract($_REQUEST);
  
                      session_destroy();
                      header("Location:login.php");
                   ?&gt;
  </code></pre>
  
  <p>how could i achieve this??</p>