Search code examples
oracle-apexoracle19coracle-apex21.2

Logout all users in Oracle Apex


I have an application in which before every release we lock all users. Once locked, user cannot login. But if the user is already logged in and then I lock the user, the user will be able to continue until sessions ends.

I'm trying to have a feature so that when I lock all users, all current active sessions of that app should be logged out or ended.

I have tried looping for all active sessions and executing apex_authentication.logout and passing session ID and app ID for each of them. Somehow if doesn't end session of anybody except the user performing the process.


Solution

  • Instead of using logout, apex_authentication.logout I'm using apex_session.delete_session. It's not 'really' a logout, but does does the job of stopping current user session. Refer https://docs.oracle.com/database/apex-18.1/AEAPI/APEX_SESSION.htm#AEAPI-GUID-E37F7000-633D-466C-BA8F-0051EDB7A0CC