Learn from sources
       Member COOKIE1 in CGIDEV2 / DEMOHTML

 /$top
 content-type: text/html
 Set-Cookie: /%ncookienam%/=/%ncookieval%/; expires=/%ncookieexp%/; domain=/%ncookiedom%/; path=/%ncookiepth%/;
 
 <HTML>
   <HEAD>
     <TITLE>Managing cookies with CGI - Basic approach</TITLE>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
 <style type="text/css">
 .title { font-family:  Arial, sans-serif; font-weight: normal; font-size: 24px; }
 .subtitle { font-family: Arial, sans-serif; font-weight: normal; font-size: 15px; }
 .boldtitle { font-family:  Arial Black, Arial, sans-serif; font-weight: Helvetica Black, bold; font-size: 24px; }
 .mono { font-family: courier; font-size: 78%; }
 td,th,caption { font-family: Arial, sans-serif; font-size: 78%; }
 pre { font-family: monospace; font-weight: normal; font-size: 12px; }
 </style>
 </HEAD>
 
 <BODY>
 
 <table>
 <tr><td>
         <div class=boldtitle>
         Managing cookies with CGI - Basic approach
         </div>
         <img src="/cgidev/blue.gif" alt="blue line" width="600" height="1">
 
 /$dspncookie
 <tr><td><p><b>The following http header was just sent:</b></p>
         <table border="1">
         <tr><td class=mono>
 Set-Cookie: /%ncookienam%/=/%ncookieval%/; expires=/%ncookieexp%/; domain=/%ncookiedom%/; path=/%ncookiepth%/;
                 </td></tr>
         </table>
         </td></tr>
 </table>
 <br><br>
 
 /$nocookies
 <table>
 <tr><td><b>No cookies were available to this page.</b>
         </td></tr>
 </table>
 
 /$tabstr
 <table>
 <tr><td>
         <p><b>The following cookies were available to this page:</b></p>
         <table border="1">
         <th></th>
         <th align=left>name</th>
         <th align=left>value</th>
 /$tabrow
         <tr><td align=right valign=top>&nbsp;/%seq%/&nbsp;</td>
             <td>/%cookienam%/</td>
             <td>/%cookieval%/</td></tr>
 /$tabend
         </table>
         </td></tr>
 </table>
 
 /$endhtml
 <table width="600">
 <tr><td><img src="/cgidev/blue.gif" alt="blue line" width="600" height="1">
         </td></tr>
 <tr><td align=center>
         <form method=post action="/cgidev2p/cookie1.pgm">
         <input type=hidden name=dummy value="/%timenow%/">
         <input type=submit value="&nbsp;Try again&nbsp;">
         </form>
         </td></tr>
 </table>
 <table width="600">
 <tr><td>
         <a href="/cgidev2p/dspsrc.pgm?cgiinp01=cgidev2&cgiinp02=demohtml&cgiinp03=cookie1"
          target="_blank"><b>Display the external html source</b></a></td>
     <td align=right>
         <a href="/cgidev2p/dspsrc.pgm?cgiinp01=cgidev2&cgiinp02=qrpglesrc&cgiinp03=cookie1"
          target="_blank"><b>Display the RPG source</b></a></td>
         </td></tr>
 </table>
 <br><br>
 <table width="600">
 <tr><td><img src="/cgidev/blue.gif" alt="blue line" height="1" width="30%">
         </td></tr>
 <tr><td><b>Note</b>.
         The CGI receives the information about the available
         cookies as soon as it is called.<br>
         Subsequently the CGI provides the html response.
         While loading the html response, the web browser
         creates / updates the cookie sent from the CGI.<br>
         This explains why the CGI is not listing the latest version
         of the cookie just sent.
         </td></tr>
 </table>
 </BODY>
 </HTML>
0.036 sec.s