22.09.2013 Views

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Modify Cookie operation as shown below.<br />

Contents of the CGI application<br />

Appendix D. CGI To <strong>SAF</strong> <strong>Subroutines</strong> Conversion <strong>Guide</strong> 123<br />

DATA DIVISION.<br />

WORKING-STORAGE SECTION.<br />

COPY COBW3.<br />

01 COOKIEDATA.<br />

02 PIC X(19) VALUE "Sample+cookie+data=".<br />

02 COOKIEVALUE PIC X(32).<br />

PROCEDURE DIVISION.<br />

:<br />

DISPLAY "HTTP_COOKIE" UPON Environment-variable-name.<br />

ACCEPT COOKIEVALUE FROM Value-of-the-environment-variable<br />

ON EXCEPTION<br />

MOVE "Error" TO COOKIEVALUE<br />

END-ACCEPT.<br />

Modified contents of the <strong>SAF</strong> application<br />

DATA DIVISION.<br />

WORKING-STORAGE SECTION.<br />

COPY COBW3.<br />

01 COOKIEVALUE PIC X(32).<br />

:<br />

PROCEDURE DIVISION USING <strong>SAF</strong>CTX.<br />

:<br />

MOVE "Sample cookie data" TO COBW3-COOKIE-NAME.<br />

CALL "COBW3_GET_COOKIE" USING COBW3.<br />

IF COBW3-STATUS = ZERO THEN<br />

MOVE COBW3-COOKIE-VALUE TO COOKIEVALUE<br />

ELSE<br />

MOVE "Error" TO COOKIEVALUE<br />

END-IF.<br />

Note: The user must execute URL encoding and URL decoding of Cookie data when<br />

handling the Cookie data by means of environment variable operation. To avoid<br />

such encoding and decoding, use Cookie data consisting of alphanumeric characters<br />

only.<br />

For example, an en-size space becomes a "+" as a result of URL encoding.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!