I am using servoy 7.4.1(web client).
Is there any way is there when user close the tab or close the browser then it should log out the solution ?
Or Is there any way when the user close the tab or browser, then next time user click on new tab or new browser and type the url then it should log out the solution instead of loading the previous session.
Hi Satya,
though I have no answer for your question, I recommend a supporting measure to ask users to always logout properly.
You could use a flag that gets set when a user logs in, and gets null when the user logs out as she should.
Then on login, you can show a message to ask the user to always use the proper way to logout.
Additionally, you could set a counter to detect those users who ignore this constantly.
This is the code we use on login.
In your logout method, you just set the flag then to null, so the flag would stay for users that do not use your intended logout button.
if (_to_person$currentpersonid.ps_did_not_logout_properly === 1) {
// Count up
_to_person$currentpersonid.ps_did_not_logout_properly_num += 1;
scopes.ui.getDialog("ps_please_use_logout");
}
_to_person$currentpersonid.ps_did_not_logout_properly = 1;
But My requirement is like when i close the tab or close the browser it should log out the system. I am using the following JQuery code but its not working.
’ $(window).on(“unload”,function() {’ +
plugins.WebClientUtils.generateCallbackScript(scopes.navigation.runMenuHandlerServoy, [“logout”]) +
‘});’
The method scopes.navigation.runMenuHandlerServoy keeps the logout logic. Any way when I am closing the tab its not calling that method as well its not log out the user, The problem is that when user type the same url its loading previous session data and solution is not working properly.
I am using servoy 7.4.1(web client).
Is there any way is there when user close the tab or close the browser then it should log out the solution ?
Or Is there any way when the user close the tab or browser, then next time user click on new tab or new browser and type the url then it should log out the solution instead of loading the previous session.
Thanks,
Satya
This is a long overdue feature that Servoy Webclient prevents by the very nature of the way it works, constantly poling the server. What would be idea is a plugin or function that allowed the developer to set the time out for inaction on the page and take the user back to login or a friendly reminder page. It both sucks up client licenses that could otherwise be used for new users and makes the page unresponsive when/if the user does return whilst it reconnects. As for educating users to log out this is a nice idea but in practice just does not work.
Not directly answering the question, but fyi, this is a feature built-in for the ng-client (Servoy .
When the user closes the browser tab (or navigates to another url in the same tab), the ng-client will be closed after a small period.
When the user returns to the page within this period, the session will be reconnected, and the user continues where it was.
This allows for resilience in case of short network outages.
Secondly: is there a way to disable this timeout from within a NGClient sessions, because this behavior is problematic when for example you (temporarily) redirect the user to another website, for example for oAuth authentication. The 60 seconds interval is too short
I expected the page to be published, I asked Johan to fix this.
Thanks for that.
The window timeout is a static setting now, but I think it could be made overridable, for instance via application.putClientProperty().
When you file a request it will be looked at.