I'm trying to avoid users to login in different computers.
I want to create a Login view, if the user is already logged and you try to login with that user, the app will display a message "user already logged" and have the option of closing the open session with a link or button.
EDIT : Apex Version 5.1.1.00.08, no possibility to updating this version.
I've tried multiple ways to close the session but none have worked so far.
FIRST ACTION :
Create the url to log out.
I'm taking the APEX_SESSION_ID from the table apex_workspace_sessions
http://xxxxxxxx.com/apex/apex_authentication.logout?p_app_id=100&p_session_id=APEX_SESSION_ID
But when I open the link it doesn't log out the user with that APEX_SESSION_ID
SECOND ACTION :
I tried to create a function to log out the session extracting APEX_SESSION_ID from the table apex_workspace_sessions but it's not working either by generating this error :
ORA-06550: line 2, column 11: PLS-00328: A subprogram body must be defined for the forward declaration of DELETE_SESSION. ORA-06550: line 6, column 16: PLS-00302: component 'DELETE_SESSION' must be declared ORA-06550: line 6, column 3: PL/SQL: Statement ignored
CODE:
declare
procedure delete_session (p_session_id in number default wwv_flow.g_instance );
begin
apex_session.delete_session (
p_session_id => APEX_SESSION_ID );
end;
the p_session_id in the image is APEX_SESSION_ID that already exists in the table apex_workspace_sessions
THIRD ACTION :
I tried to run the query
DELETE FROM APEX_050000.wwv_flow_sessions$ WHERE ID = APEX_SESSION_ID;
displaying the error : ORA-00942: table or view does not exist
and the query
DELETE FROM apex_workspace_sessions WHERE APEX_SESSION_ID = APEX_SESSION_ID;
displaying the error : ORA-01031: insufficient privileges
FOURTH ACTION :
I tried to use the LOGOUT PROCEDURE from the official oracle docs but didn't work either
apex_authentication.logout(APEX_SESSION_ID, :APP_ID);
no error or anything to display.
Does anyone knows how to log out a user from another computer ?
Thanks