Problems with session ID on public pages (upgrade from APEX 2.2.1 to 3.1.1)
In one of our applications, we have a region on a page that prints the contents of a public page according to some parameters (using utl_http to get the public page and htp to print it). On APEX 2.2.1, we get the session ID to use in the URL to that public page using wwv_flow.get_next_session_id(), and it used to work fine.
After we upgrade to APEX 3.1.1, it doesn't work anymore. We believe this is caused by the new feature introduced on APEX 3.0 "Friendly URL Syntax to Facilitate Bookmarks" (session ID = 0 for public pages).
We changed the procedures that generate the public URL using session ID = 0 instead of wwv_flow.get_next_session_id and now is working fine.
Is there a way to maintain the previous usage of the session id for public pages?
Does anybody know if there are other issues to take into account if we change the session id to 0 on public page's URLs?
Thanks in advance,
Nicolas
PS:
Here's a code example of the problem:
This script works fine with APEX 2.2.1, but with APEX 3.1.1 I have to set the variable v_sid to 0 in order to make it work (with v_sid := '9876543210123456789', it throws "ORA-29273: HTTP request failed"):
----------------------------------------------------------
DECLARE
v_sid VARCHAR2(20);
--
FUNCTION get_web_page (p_url IN VARCHAR2)
RETURN CLOB
IS
v_req UTL_HTTP.req;
v_resp UTL_HTTP.resp;
v_value CLOB;
BEGIN
v_req := UTL_HTTP.begin_request (url => p_url, method => 'GET');
UTL_HTTP.set_header (r => v_req,
NAME => 'Content-Type',
VALUE => 'text/html'
);
v_resp := UTL_HTTP.get_response (r => v_req);
UTL_HTTP.read_text (v_resp, v_value, LENGTH (v_value));
UTL_HTTP.end_response (r => v_resp);
RETURN v_value;
END;
--
BEGIN
--
v_sid := '9876543210123456789';
--
begin
--Page 2 on app 15015 has public access
htp.p(get_web_page('http://apex.oracle.com/pls/otn/f?p=15015:2:'||v_sid||'::NO:'));
EXCEPTION
WHEN OTHERS THEN
htp.p(get_web_page('http://apex.oracle.com/pls/otn/f?p=15015:2:'||v_sid||'::NO:'));
END;
END;
----------------------------------------------------------
Message was edited by:
nicolas.vallejo