title: Logout webpage when click on refresh button
body: <p>I am developing a website. Where I need to logout the page when one try to refresh the page.</p>
  
  <p>I got the code for logout when one click on <code>f5</code> for refresh and also I got the code for disable <code>right click</code> on the page. but I dont know how to prevent the refresh button of browser or logout when I press refresh button. I searched many sites. But didn't get an answer.</p>
  
  <p>The code I gor for <code>F5</code> key is</p>
  
  <pre><code>function fkey(e){
      e = e || window.event;
     if( wasPressed ) return; 
  
      if (e.keyCode == 116) {
           alert("f5 pressed");
          wasPressed = true;
      }else {
          alert("Window closed");
      }
  }
  </code></pre>
  
  <p>Can anyone please help me for the issue with refresh button? </p>