I am developing a website. Where I need to logout the page when one try to refresh the page.
I got the code for logout when one click on f5 for refresh and also I got the code for disable right click 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.
The code I gor for F5 key is
function fkey(e){
    e = e || window.event;
   if( wasPressed ) return; 
    if (e.keyCode == 116) {
         alert("f5 pressed");
        wasPressed = true;
    }else {
        alert("Window closed");
    }
}
Can anyone please help me for the issue with refresh button?
 
     
     
    