0
how logout when close the browser tab in JavaScript
Window.onbeforeunload function not working
4 Antworten
+ 3
SGB
Here is an example from w3schools
https://code.sololearn.com/W6gheChtG0mW/?ref=app
0
SGB can you please show us your code including the above function as there are some whom can clarify this issue.
Thanks and happy coding
0
@BroFar here my code something look like:
window.onbeforeunload = function(event) {
var isOK = confirm("Are you sure to Leave this Page?");
if(isOK) {
LogoutFuncton();
}
}
function LogoutFuncton (){
top.location.href= logouturl
}
0
BroFar I need to destroy the session when user close the tab without logout