17
Views
1
Comments
Using the onunload javascript function to force a log off of app
Question
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
2020-12-07 17-35-54
António Chinita
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.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.