1.00 |
/$top |
2.00 |
content-type: text/html |
3.00 |
/%setmycookie%/ |
4.00 |
expires: 0 |
5.00 |
|
6.00 |
<HTML> |
7.00 |
<HEAD> |
8.00 |
<TITLE>Example of managing cookies with CGI</TITLE> |
9.00 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
10.00 |
|
11.00 |
<style type="text/css"> |
12.00 |
<!-- |
13.00 |
.title { color: blue; font-weight: bold; font-size: 24pt; font-family: souvenir lt bt, verdana, serif; align: center} |
14.00 |
.subtitle { color: black; font-weight: bold; font-size: 12pt; font-family: souvenir lt bt, verdana, serif; align: center} |
15.00 |
.reg {font-size: 10pt; font-family: arial, helvetica, helv} |
16.00 |
.boldtitle { font-family: Arial Black, Arial, sans-serif; font-weight: Helvetica Black, bold; font-size: 24px; } |
17.00 |
.mono { font-family: courier; font-size: 10pt; } |
18.00 |
td,th,caption { font-family: Arial, sans-serif; font-size: 10pt; } |
19.00 |
pre { font-family: monospace; font-weight: normal; font-size: 10pt; } |
20.00 |
--> |
21.00 |
</style> |
22.00 |
<script language="javascript"> |
23.00 |
function TS() {ts=Math.random(); return ts;} |
24.00 |
</script> |
25.00 |
</HEAD> |
26.00 |
|
27.00 |
<BODY TEXT="black" LINK="blue" VLINK="blue" ALINK="blue" BGCOLOR="white"> |
28.00 |
|
29.00 |
<table width="600"> |
30.00 |
<tr><td><table width="100%" cellspacing="0" cellpadding="0"> |
31.00 |
<tr><td valign=top><img src="/cgicbldev2/graphics/pears.gif" |
32.00 |
alt="Giovanni's logo"></td> |
33.00 |
<td valign=middle> |
34.00 |
<div class=title> |
35.00 |
Example of managing cookies with CGI |
36.00 |
</div> |
37.00 |
</td> |
38.00 |
<td valign=middle><img src="/cgicbldev2/graphics/v2.gif" |
39.00 |
alt="this means Version 2"> |
40.00 |
</td></tr> |
41.00 |
<tr><td colspan=3> |
42.00 |
<table width="100%" cellspacing="0" cellpadding="0"> |
43.00 |
<tr><td width="100%"> |
44.00 |
<img src="/cgicbldev2/graphics/blue.gif" alt="blue line" border="0" |
45.00 |
height="1" width="100%"> |
46.00 |
</td></tr> |
47.00 |
</table> |
48.00 |
</td></tr> |
49.00 |
</table> |
50.00 |
</td></tr> |
51.00 |
</table> |
52.00 |
<br><br> |
53.00 |
<table> |
54.00 |
<tr><td><p><b>The following http header was just sent:</b></p> |
55.00 |
<table border=1> |
56.00 |
<tr><td class=mono>/%setmycookie%/ |
57.00 |
</td></tr> |
58.00 |
</table> |
59.00 |
</td></tr> |
60.00 |
</table> |
61.00 |
<br><br> |
62.00 |
|
63.00 |
/$cookieno |
64.00 |
<table> |
65.00 |
<tr><td><b>Cookie <font color=red><b>/%cookienam%/</b></font> not available to this page.</b> |
66.00 |
</td></tr> |
67.00 |
</table> |
68.00 |
|
69.00 |
/$cookieyes |
70.00 |
<table> |
71.00 |
<tr><td> |
72.00 |
<tr><td><b>Cookie <font color=red>/%cookienam%/</font> could be retrieved.</b> |
73.00 |
<p>Its value is: |
74.00 |
<table border=1> |
75.00 |
<tr><td class=mono>/%cookieval%/</td></tr> |
76.00 |
</table> |
77.00 |
</td></tr> |
78.00 |
</table> |
79.00 |
|
80.00 |
/$endhtml |
81.00 |
<table width="600"> |
82.00 |
<tr><td><img src="/cgicbldev2/graphics/blue.gif" alt="blue line" width="600" height="1"> |
83.00 |
</td></tr> |
84.00 |
<tr><td align=center> |
85.00 |
<form method=post action="/cgicbldev2p/cookie.pgm"> |
86.00 |
<script language=javascript> |
87.00 |
document.write("<input type=hidden name=xdocloc value='"+document.location+"'>") |
88.00 |
</script> |
89.00 |
<input type=submit value=" Try again "> |
90.00 |
</form> |
91.00 |
</td></tr> |
92.00 |
</table> |
93.00 |
<table width="600"> |
94.00 |
<tr><td> |
95.00 |
<a href="/cgicbldev2p/dspsrc.cgi?srclib=cgicbldev2&srcfile=htmlexampl&srcmbr=cookie" |
96.00 |
target="_blank"><b>Display the external html source</b></a></td> |
97.00 |
<td align=right> |
98.00 |
<a href="/cgicbldev2p/dspsrc.cgi?srclib=cgicbldev2&srcfile=qcbllesrc&srcmbr=cookie" |
99.00 |
target="_blank"><b>Display the COBOL source</b></a></td> |
100.00 |
</td></tr> |
101.00 |
</table> |
102.00 |
<br><br> |
103.00 |
<table width="600"> |
104.00 |
<tr><td><img src="/cgicbldev2/graphics/blue.gif" alt="blue line" height="1" width="30%"> |
105.00 |
</td></tr> |
106.00 |
<tr><td><b>Note</b>. |
107.00 |
The CGI receives the information about the available |
108.00 |
cookies as soon as it is called.<br> |
109.00 |
Subsequently the CGI provides the html response. |
110.00 |
While loading the html response, the web browser |
111.00 |
creates / updates the cookie sent from the CGI.<br> |
112.00 |
This explains why the CGI is not listing the latest version |
113.00 |
of the cookie just sent. |
114.00 |
</td></tr> |
115.00 |
</table> |
116.00 |
</BODY> |
117.00 |
</HTML> |