Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi,
When any user is idle for more than the idle session timeout duration the session is terminated, but there is no change in the browser page until we reload it.
So I am trying to manually terminate the Runtime users after idle timeout duration. But I want to show a message once the user is terminated in the by redirecting to a url or a mashup after logout.
When I am trying to redirect to mashup, along with the mashup I also get an error message as "mashup not found" or else the mashup does not load at all and I get a blank screen.
If I redirect to a url, I see the logout message shown in status message only for a split second as the URL gets loaded immediately.
Is there any way I can display the message without it being overridden by any other page or additional error messages.
Thanks & Regards,
Bhushan
I think you can create a custom service with a content of pause for seconds, e.g.,
pause(3000); // pause for 3 seconds
Then you can trigger this service by whatever the way you did (maybe like a button, and you might show the status message right after the button click), after the service execution was complete, trigger the logout function.
By doing so, you will get 3 seconds before logout, therefore, your status message stays for that amount of time.
Hi @CharlesJi ,
Thanks for the input.
I have taken a different approach.
1. Create a Timer service to get the list of users with active session and monitor which user becomes idle.
2. Pass the list of users that are breaching idle timeout value, to the mashup by updating the session Variable.
3. On the Mashup end, check if the current user is present in session variable's User List. This is triggered on Event "SessionVariableChange".
4. If true then call a mashup with using navigate widget and pass the username.
5. Call this Mashup with Replace mode instead of opening a pop up or New Tab.
6. In this mashup, display the session Expired message on Mashup Load.
7. After Display of Message trigger the TerminateUserSession Service from CurrentSessionInfo Resource.
This way I am able to terminate the user session, and keep the message of Session Expired or terminated on Display.
Everything works fine, in this setup, Except for the session variable update.
I am not able to update the Session Variable, If I trigger the update service manually it works, but if I am calling the service using a Subscription of Timer Event, it is not updating.
My ThingWorx version is 8.5.4.
Request your help if you have any inputs on this.
Thanks and Regards,
Bhushan