Also i believe in the community commons there is a Java Action called JA_Logoff that you can place in any microflow and it will log the user out right then and there.
Hi Jonas,
This can be done with a custom java action.
com.mendix.core.Core.logout(getContext().getSession());
https://apidocs.mendix.com/7/runtime/
Here is some documentation on java actions
https://docs.mendix.com/refguide7/java-actions
Hope this helps!
Do note that from a page it can be much simpeler. Just drop a button and use the Sign out option in the On click events.
Regards,
Ronald