rasti.hil@hilandco.com +41 79 367-9677

Friday, 11 November 2011

PL/SQL delete cookie

CREATE OR REPLACE PROCEDURE COOKIE(name VARCHAR2 DEFAULT 'SSO_ID') IS
vblob BLOB;
buffer RAW(32000);
buffer_size INTEGER := 32000;
offset INTEGER := 1;
length NUMBER;
base64 VARCHAR2(2000):='R0lGODlhDQANAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAADQANAAAINAAfCBxIsKDBgwcZKCSAUCEDhg8YFFw40GHFhwUJSIyI0aDDjgY1gjxIACLCByZPqlwpMCAAOw==';

--grant execute on cookie to public;
--IMG SRC="'||wwctx_api.get_server_protocol ||'://'||v_host_portal||'/portal/pls/portal/portal_tools.cookie?name=portal" style="width: 0px; height: 0px;"
BEGIN


owa_util.mime_header('image/gif',FALSE);



owa_cookie.send( name => name,
value => '',
expires => TO_DATE('01-01-1990','mm-dd-yyyy'),
path => '/',
domain => NULL,
secure => NULL);



owa_util.http_header_close;

vblob:=UTL_ENCODE.BASE64_DECODE( UTL_RAW.CAST_TO_RAW(to_char(base64)) );


length := dbms_lob.getlength(vblob);

WHILE offset < length LOOP
dbms_lob.read(vblob, buffer_size, offset, buffer);
htp.prn(utl_raw.cast_to_varchar2(buffer));
offset := offset + buffer_size;
END LOOP;

EXCEPTION
WHEN OTHERS THEN
htp.p(sqlerrm);
END;
/

No comments: