Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to kick out after closing the tab #39

Open
mralperem opened this issue May 25, 2020 · 1 comment
Open

How to kick out after closing the tab #39

mralperem opened this issue May 25, 2020 · 1 comment

Comments

@mralperem
Copy link

Hello i can kick out the user when i change the tab but when i close is and open it back the user wouldnt be kicked out. Can anyone help me with that.

$(document).idle({ onIdle: function(){ Swal.fire({ title: 'Oturum Sonlandırıldı', text: "5 Dakikadır herhangi bir işlem yapılmadığından dolayı oturumunuz otomatik olarak sonlandırıldı!", icon: 'warning', showCancelButton: false, confirmButtonColor: '#3085d6', confirmButtonText: 'Tamam' }).then((result) => { if (result.value) { window.location.href = "assets/includes/logout.php"; } }); }, onShow: function(){ window.location.href = "assets/includes/logout.php"; }, idle: 3000 // Kick out after 1 Minute (60000 ms is equal to 1 min) })

@henriqueboaventura
Copy link
Owner

I'm pretty sure that when you close the tab, all the timeouts that were set go away with the tab. Maybe you are looking for something like this https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants