PL/SQL Packages and Types Reference 10g Release 1 (10.1) Part Number B10802-01 |
|
|
View PDF |
The OWA_COOKIE package provides an interface for sending and retrieving HTTP cookies from the client's browser.
The chapter contains the following topics:
Cookies are opaque strings sent to the browser to maintain state between HTTP calls. State can be maintained throughout the client's sessions, or longer if an expiration date is included. The system date is calculated with reference to the information specified in the OWA_CUSTOM package.
This data type contains cookie name-value pairs. Since the HTTP standard allows cookie names to be overloaded (that is, multiple values can be associated with the same cookie name), there is a PL/SQL RECORD
holding all values associated with a given cookie name.
TYPE vc_arr IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER. TYPE COOKIE IS RECORD ( name VARCHAR2(4000), vals vc_arr, num_vals INTEGER);
All HTTP headers must be in English and the ASCII character set. If the headers are generated from the database, verify they are created in the English language.
Subprogram | Description |
---|---|
Gets the value of the specified cookie | |
Gets all cookie name-value pairs | |
Removes the specified cookie | |
Generates a "Set-Cookie" line in the HTTP header |
This function returns the values associated with the specified cookie. The values are returned in a OWA_COOKIE.COOKIE
DATA
TYPE
.
OWA_COOKIE.GET( name IN VARCHAR2) RETURN COOKIE;
Parameter | Description |
---|---|
|
The name of the cookie. |
OWA_COOKIE.COOKIE
DATA
TYPE
.
This procedure returns all cookie names and their values from the client's browser. The values appear in the order in which they were sent from the browser.
OWA_COOKIE.GET_ALL( names OUT vc_arr, vals OUT vc_arr, num_vals OUT INTEGER);
Parameter | Description |
---|---|
|
The names of the cookies. |
|
The values of the cookies. |
|
The number of cookie-value pairs. |
This procedure forces a cookie to expire immediately by setting the "expires" field of a Set-Cookie line in the HTTP header to "01-Jan-1990". This procedure must be called within the context of an HTTP header.
OWA_COOKIE.REMOVE( name IN VARCHAR2, val IN VARCHAR2, path IN VARCHAR2 DEFAULT NULL);
Parameter | Description |
---|---|
|
The name of the cookie to expire. |
|
The value of the cookie. |
|
[Currently unused] |
This procedure generates a Set-Cookie line, which transmits a cookie to the client. This procedure must occur in the context of an HTTP header.
OWA_COOKIE.SEND( name in varchar2, value in varchar2, expires in date DEFAULT NULL, path in varchar2 DEFAULT NULL, domain in varchar2 DEFAULT NULL, secure in varchar2 DEFAULT NULL);