We are in the process of upgrading Apex 4.2 to Apex 21.2 and have hit an issue. Wondering if anyone else had encountered something similar
When invoking an apex application through plsql using a url I get a session timeout error
url invokes a procedure though a synonym in another scheme pointing at the package
the parameters are gathered out of the url and passed to another procedure.
This procedure then does a form submit to reinvoke the procedure to hide the url parameters using htp.p
then tries to invoke the application using the F(P=>url) notation.
error is received is:
Apex error on page 120 apex_error_code APEX.SESSION.EXPIRED is_internal_error true ora_sqlcode ora_sqlerrm component APEX_APPLICATION_AUTH-332571137123654620-DATABASE
error backtrace ----- PL/SQL Call Stack -----
object line object
handle number name
0xb6dcda80 976 package body APEX_210200.WWV_FLOW_ERROR.INTERNAL_GET_ERROR
0xb6dcda80 1044 package body APEX_210200.WWV_FLOW_ERROR.INTERNAL_ADD_ERROR
0xb6dcda80 1517 package body APEX_210200.WWV_FLOW_ERROR.RAISE_INTERNAL_ERROR
0xadb84a50 1678 package body APEX_210200.WWV_FLOW_SESSION.RAISE_EXPIRED_ERROR
0x7ca1f750 1618 package body APEX_210200.WWV_FLOW_AUTHENTICATION.AUTHENTICATE_AND_INIT_SESSION
0xb6f4e5a0 2519 package body APEX_210200.WWV_FLOW.SHOW
0xb12ff088 173 procedure APEX_210200.F
0x84ec2168 1042 package body TRAVEL_WS.TRAVEL_EXTERNAL_PKG.RUNAPP
0x84ec2168 1059 package body TRAVEL_WS.TRAVEL_EXTERNAL_PKG.RUNAPP
0x707f3768 2 anonymous block
Example of call:
procedure runapp (pi_app in varchar2 default null,
pi_page in varchar2 default null,
target in varchar2 default null,
useform in varchar2 default 'Y') is
v_url varchar2(4000);
v_url_f varchar2(4000);
v_source varchar2(100) := 'travel_external_pkg.runapp';
begin
clog_api.ins(p_text => 'pi_app = '||pi_app, p_source => v_source);
clog_api.ins(p_text => 'pi_page = '||pi_page, p_source => v_source);
clog_api.ins(p_text => 'target = '||target, p_source => v_source);
clog_api.ins(p_text => 'useform = '||useform, p_source => v_source);
if target is null and useform = 'Y'
then
v_url := '?app='||pi_app||'&page='||pi_page||'&useform='||useform;
clog_api.ins(p_text => 'v_url = '||v_url , p_source => v_source);
clog_api.ins(p_text => 'Start Form Post', p_source => v_source);
htp.htmlopen;
htp.HEADOPEN;
htp.HEADCLOSE;
htp.bodyopen(cattributes=>'onload="document.returnform.submit();" ');
htp.formopen(curl=>'!travel.runapp'||v_url ,cmethod=>'post',ctarget=>'_top',cattributes=>'name="returnform"');
htp.formhidden(cname=>'target',cvalue=>'_top');
htp.formclose;
htp.bodyclose;
htp.htmlclose;
else
clog_api.ins(p_text => 'Start Redirect', p_source => v_source);
v_url_f:= pi_app||':'||pi_page||':::NO:SESSION:';
clog_api.ins(p_text => 'v_url_f = '||v_url_f , p_source => v_source);
f(p=>v_url_f);
end if;
exception when others then
elog_api.ins;
end runapp;
procedure runapp (name_array apex_application_global.vc_arr2
,value_array apex_application_global.vc_arr2) is
begin
clog_api.ins(p_text => 'Start URL Extraction', p_source => 'travel_external_pkg.runapp');
runapp(
pi_app=>get_val('app','102',name_array,value_array),
pi_page=>get_val('page','120',name_array,value_array),
target=>get_val('target','',name_array,value_array),
useform=>get_val('useform','Y',name_array,value_array));
exception when others then
elog_api.ins;
end runapp;
If the below procedure is run using this url it fails:
http://wl-sprdev-middle.group.net:8001/ords/travel_external/!travel.runapp?app=102&page=120&useform=Y
If run not using the form submit it works:
http://wl-sprdev-middle.group.net:8001/ords/travel_external/!travel.runapp?app=102&page=120&useform=N
Then once a session is in the browser the original url will now work:
http://wl-sprdev-middle.group.net:8001/ords/travel_external/!travel.runapp?app=102&page=120&useform=Y