Description: Create a function called cookie_exists. It checks for the existence of a cookie with the name passed in, using OWA_COOKIE.GET. The function returns TRUE if a value is found for a cookie with that name. It returns FALSE if there are no values stored for a cookie with that name.
CREATE OR REPLACE FUNCTION cookie_exists
(p_cookie_name IN VARCHAR2)
RETURN BOOLEAN
IS
--------------------------------------------------------
-- FILENAME: cookie_exists
-- FILEDATE: 01.20.2003
-- CREATED BY: Susan Boardman
-- DESCRIPTION: Checks whether a cookie exists with name passed in.
-- URL : cookie_exists
--------------------------------------------------------
v_cookie OWA_COOKIE.COOKIE;
BEGIN
v_cookie := OWA_COOKIE.GET(p_cookie_name);
IF v_cookie.num_vals != 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;