Why is System.Session LastActive updated on microflow trigger?

Hi all,   I am working on a feature to prevent idle anonymous users from keeping their session on our app. I have already set the EnableKeepAlive to false in StudioPro. On a page I use the microflow timer widget to trigger a microflow which checks the difference between now and the Session/LastActive time, and applies custom logic if a certain threshold is reached. I’m expecting that if nothing happens on the page there will be a time difference between the LastActive attribute and the time at which the microflow is triggered. I have been checking this using the debugger and every time the microflow is triggered, so is the updating of the Session/LastActive, as well as the context entity’s changedDateTime, which is obviously not the desired behavior.   Does anyone know why this happens, as in for instance if it is indeed normal for the Session/LastActive to be updated every time a microflow is triggered / how to prevent this from happening?   Thank you in advance, Margaux  
1 answers


The microflow timer uses the current (anonymous) session to execute a microflow.  Because of this, the behavior you describe is correct.  The microflow timer is keeping your anonymous sessions alive.  


If you set EnableKeepAlive to false, the platform will get rid of anonymous sessions after 10 minutes ( the default timeout ).  Or you could set the runtime setting SessionTimeout to a shorter time so that the platform will get rid of anonymous sessions more quickly.


Be aware that SessionTimeout applies to both anonymous and authenticated sessions.


Hope that helps,