0

I am creating a site where when I log in to a table that I have of users, the status field goes from 0 to 1, I have a button where you can log out and this field goes from 1 to 0, all right up to here. But when the user closes the browser without logging out from the button, the status remains 1, and when wanting to log in again it throws me an already established validation, the validation is for users who are in status 1, can not enter with another team with the same account.

I was investigating and I found the JS unload and onbeforeunload events, this so that when closing the browser it detects the event and updates the DB, it works for me but I have had some compatibility problems, I am using validations in these events since at the time of reloading the page or click on another menu tab, the event is not detected, I am having problems with the Edge browser.

Does anyone have any ideas on how to solve this problem, thank you in advance.

0 Answers0