I'm trying to implement validation that depends on attributes that users have in their apex session. For example when you as a user pick for ATRIBUTE VALUE1 apex should check if there is another active session with the same attribute value. If there is any user can't move on.
I created function that checked session items (apex_190200.WWV_FLOW_DATA_VIEW) and thats working fine. But I have problem with closing session and releasing items. I'm using SSO so there is no "LOG OUT". I'm trying to find solution for closing/deleting apex session after user closing browser or tab with apex. At least clear cache of all items that was in this session. we can do it with
begin
apex_session.delete_session (
p_session_id => v('APP_SESSION'));
apex_session.detach;
end;
But I can't find how to launch it before window/tab is closed.
Or maybe there is some setting that allow to have apex session existing only when the application is open in browser?