Top
NetCOBOL V11.0 ISAPI Subroutines User's Guide
FUJITSU Software

D.11 Manipulating a CGI Environment Variable

A CGI application can reference a "CGI environment variable" using the COBOL environment variable operation function while an ISAPI application cannot. Thus, the following three subroutines are used.

COBW3_RECEIVE_HEADER

Get an HTTP header.

COBW3_GET_REQUEST_INFO

Get various information on a request.

COBW3_GET_AUTHORIZE

Get authorization information.

A CGI application can set and reference Cookie data using the COBOL environment variable operation function while an ISAPI application cannot. Thus, the following special subroutines are used to handle Cookie data.

COBW3_SET_COOKIE_XX, etc.

Register Cookie data.

COBW3_DEL_COOKIE_X, etc.

Delete the existing Cookie data.

COBW3_INIT_COOKIE

Initialize Cookie data to be sent to a client.

COBW3_GET_COOKIE_XX, etc.

Get Cookie data included in a request.

For example, modify the processing that gets information from an HTTP header as follows:

Modify the Cookie manipulation as follows:

To handle Cookie data through environment variable manipulation, the user needs to encode and decode URLs in the Cookie data. To work around this problem, use only alphanumeric characters in Cookie data.

Note that an en-size space, after URL encoding, becomes "+".