Using the onunload javascript function to force a log off of app

Using the onunload javascript function to force a log off of app

  
Hello Everyone,
I have another javascript question with Outsystems.  I want my app to log off automatically when a user exits the browser without pressing the LogOut button that I have coded in the app.  How do I implement that by using the onunload function or perhaps another technique that is easier?
Frank
Frank wrote:
Hello Everyone,
I have another javascript question with Outsystems.  I want my app to log off automatically when a user exits the browser without pressing the LogOut button that I have coded in the app.  How do I implement that by using the onunload function or perhaps another technique that is easier?
Frank
 
 Hi Frank.
What you need should actually be happening by default.

Did you build your custom login? If so, check if you aren't setting the "Remember" variable to True.

Remember this works only when you exit the browser. It won't work if you simply close the Browser Tab without fully closing the browser.

Javascript's OnUnload is tricky to use, and you should avoid it whenever possible.
For example, it will trigger for every Navigate or Submit button.