Description: This function is reusable. It has an IN parameter of a cookie name. The function checks for the existence of a cookie with the name that is passed in. If a cookie exists with that name, the procedure returns the cookie value. Otherwise, it returns a NULL value.
CREATE OR REPLACE FUNCTION get_cookie (p_cookie_name IN VARCHAR2) RETURN VARCHAR2 IS -------------------------------------------------------- -- FILENAME: get_cookie -- FILEDATE: 01.20.2003 -- CREATED BY: Susan Boardman -- DESCRIPTION: Retrieves cookie with name passed in -- URL : get_cookie -------------------------------------------------------- v_cookie OWA_COOKIE.cookie; BEGIN v_cookie := OWA_COOKIE.GET(p_cookie_name); IF v_cookie.num_vals != 0 THEN RETURN v_cookie.vals(1); ELSE RETURN NULL; END IF; END;