Navigate to screen after timeout
-
Michael GroßHas successfully completed the online course Intermediate (200)Has successfully completed the online course Basics (100)1 year ago #36972
Hi everyone,
Is it possible to navigate to a specific screen after a timeout. In my Application the user has to fill in some informations into an input mask. After that a connector is triggered to save the data. But if the user has the Application opened for a while he will get a session timeout without noticing. He is also able to still fill in the information to the input fields but if he wants to save the data and trigger the connector the page will be refreshed and all the informations are gone which is really frustrating. I already tried:
try { var pages = sap.ui.getCore().byId("Application").getPages(); for (var i = 0; i < pages.length; i++) { pages[i].getController()._handleRequestError = function(showBusyIndicator, failCallback, ajaxSetup, errorData) { if (showBusyIndicator) { sap.ui.core.BusyIndicator.hide(); } var status = errorData.status; this.navTo("Login", "Slide"); this.setItemValue("Screen_Dialogs", "Dialog_Inactivity", "dialogOpened", true); }; } } catch (e) { console.log('Inactivity handle Error: ', e); }
Is there some Error in my code or how can I let the user know when there is a session timeout?
Alex KHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)1 year ago #37397::I would suggest using a timer-based solution, that checks in intervals if the session still persists. Once that fails, then the redirection would be triggered. This keeps the session alive as long as the tab is still in “active” state. As long as the user uses 2 Tabs, the “active” state shifts and the timeout triggers the timeout redirect.
Additionally to this, you also have the option to select “notify before logout” option when logging in in the Process designer, also having the ability to enter a Time in minutes. This does not seem to work on my end until a manual Logout is being triggered.
Due to the nature of Design, there also is a Server Action for Logout. This could be triggered instead of the redirect as this ends the session actively, if you want to reduce the session time.Use this code right after the login in a script for manual notification:
setTimeout( function() { alert("Your session will expire in 5 minutes."); }, 5*60*1000); // Calculation for 10 Minutes session time
You must be logged in to reply to this topic.