I have this problem:
I use "APEX_CLONE_SESSION" to have multiple independent sessions in the same browser. It works, but when the user create a new primary session all the others previous sessions are expired.
Example: I have some initial page that starts the application on a new session, in this page I have a report that have a link column. This link column start a new form page session with "APEX_CLONE_SESSION". I can do this many times and works. So, at the moment, I have the initial page report and multiple form pages with independent sessions.
The problem starts when, for some reason, the user start a new primary session on click somewhere that start the new initial page. When this happens all previous session are expired.
Is there anyway to persist the sessions created by the "APEX_CLONE_SESSION" when a new primary session is created?
Thanks for help.
At the moment I try this approach to solve the problem.
1 - I create one application to have only one public page. This page function is only to redirect to my target application.
2 - In my initial page of my target application, I store the session generated by apex using localStorage.
localStorage.setItem('myappsession','&APP_SESSION.');
3 - In my user interface I define my "HOME URL" as the url of my public page.
4 - This public page get the value of the session from localStorage and redirect to my target application.
5 - I put the code that redirect to my target application on the header of the public page, so this action occurs in the first moment and the user don't see any difference.
<script>
var session = localStorage.getItem('myappsession');
if (session == null) {
session = 0;
}
location.href = 'f?p=appalias:startpage:' + session;
</script>