start or resume session PERFORM HTM2COB-SESS-START DISPLAY "

    HTM2COB-HIDDEN-SESSION-ID: " HTM2COB-HIDDEN-SESSION-ID"

" ?>

## Mars Planet Webshop

##### Sorry, there is no return ticket back to Earth...

### Enter quantities for items

Nr. | Item | Price ($) | Quantity
--- | --- | --- | ---

Mars Planet Webshop start page

------------------------------------------------------------------------------ LIST-CAT-ITEMS SECTION. *>------------------------------------------------------------------------------ CALL "HTM2COB-POST" USING "selcatnr", WS-SEL-CAT-NR END-CALL PERFORM VARYING WS-IND FROM 1 BY 1 UNTIL WS-IND > CAT-ITEM-MAX-IND IF WS-CAT-NR OF WS-CAT-ITEM-TAB(WS-IND) = WS-SEL-CAT-NR THEN MOVE WS-CAT-ITEM-NR OF WS-CAT-ITEM-TAB(WS-IND) TO WS-SEL-ITEM-NR PERFORM READ-ITEMS-FROM-SESS MOVE WS-CAT-ITEM-PRICE OF WS-CAT-ITEM-TAB(WS-IND) TO WS-PRICE-DISP DISPLAY "
" ""WS-CAT-ITEM-NR OF WS-CAT-ITEM-TAB(WS-IND)"" ""FUNCTION TRIM(WS-CAT-ITEM-NAME OF WS-CAT-ITEM-TAB(WS-IND))"" ""WS-PRICE-DISP"" "" "
" END-DISPLAY END-IF END-PERFORM EXIT SECTION . *>------------------------------------------------------------------------------ READ-ITEMS-FROM-SESS SECTION. *>------------------------------------------------------------------------------ MOVE ZEROES TO WS-QTY MOVE WS-SEL-CAT-ITEM TO HTM2COB-SESS-VAR-NAME PERFORM HTM2COB-SESS-GET IF V-OK OF LNK-RESULT OF LNK-HTM2COB-SESSION THEN MOVE HTM2COB-SESS-VAR-VALUE TO WS-QTY-TMP IF FUNCTION TEST-NUMVAL(WS-QTY-TMP) = ZEROES AND FUNCTION NUMVAL(WS-QTY-TMP) > ZEROES THEN MOVE FUNCTION NUMVAL(WS-QTY-TMP) TO WS-QTY END-IF END-IF EXIT SECTION . *> Implement this section, if you want to set a cookie. *>------------------------------------------------------------------------------ HTM2COB-SET-COOKIE SECTION. *>------------------------------------------------------------------------------ *> get remote address and http user agent of the visitor PERFORM HTM2COB-GET-SESS-ENV-PARAMS *> get session-id from cookie INITIALIZE LNK-HTM2COB-GET-COOKIE MOVE "SESSIONID" TO LNK-COOKIE-NAME OF LNK-HTM2COB-GET-COOKIE CALL "HTM2COB-GET-COOKIE" USING LNK-HTM2COB-GET-COOKIE END-CALL MOVE FUNCTION TRIM(LNK-COOKIE-VALUE OF LNK-HTM2COB-GET-COOKIE) TO HTM2COB-HIDDEN-SESSION-ID *> regenerate session PERFORM HTM2COB-SESS-REGENERATE *> update session-id in cookie string MOVE HTM2COB-HIDDEN-SESSION-ID TO LNK-SESSION-ID-HEX OF LNK-HTM2COB-UPD-SESS-STR CALL "HTM2COB-UPD-SESS-STR" USING LNK-HTM2COB-UPD-SESS-STR END-CALL *> save session-id in cookie INITIALIZE LNK-HTM2COB-SET-COOKIE SET V-SET OF LNK-COOKIE-FUNC OF LNK-HTM2COB-SET-COOKIE TO TRUE MOVE "SESSIONID" TO LNK-COOKIE-NAME OF LNK-HTM2COB-SET-COOKIE MOVE HTM2COB-HIDDEN-SESSION-ID TO LNK-COOKIE-VALUE OF LNK-HTM2COB-SET-COOKIE MOVE 1800 TO LNK-MAX-AGE-SEC OF LNK-HTM2COB-SET-COOKIE MOVE "localhost" TO LNK-DOMAIN-VALUE OF LNK-HTM2COB-SET-COOKIE MOVE "/" TO LNK-PATH-VALUE OF LNK-HTM2COB-SET-COOKIE SET V-YES OF LNK-HTTPONLY-FLAG OF LNK-HTM2COB-SET-COOKIE TO TRUE SET V-YES-LAX OF LNK-SAMESITE-FLAG OF LNK-HTM2COB-SET-COOKIE TO TRUE CALL "HTM2COB-SET-COOKIE" USING LNK-HTM2COB-SET-COOKIE END-CALL *> The last DISPLAY in this section is always with "WITH NO ADVANCING" DISPLAY FUNCTION TRIM(LNK-COOKIE-STR OF LNK-HTM2COB-SET-COOKIE) WITH NO ADVANCING END-DISPLAY EXIT SECTION . ?>