This script shows how to set a cookie manually, and then dump the environment
to show it.. The cookie will automatically be made available to anyone
accessing any document under the specified path '/' on my domain
'ringways.co.uk'.
In Perl, you read the cookies from $ENV{HTTP_COOKIE}
No doubt, CGI.pm will do all this for you too.
Gary
#!/usr/bin/perl -w
print <<EOF;
Content-Type: text/html
Set-Cookie: mycookie=1; path=/; domain=equipment.ringways.co.uk;
<html><head><title>hello</title></head>
<body><h1>hello</h1><table width=80%, border=2>
<tr>
<th width=30%>Label</th>
<th width=50%>Value</th>
</tr>
EOF
while (($KEY,$VALUE) = each(%ENV)) {
$VALUE='<empty>' if (!$VALUE);
print "
<tr>
<td width=30%>$KEY</td>
<td width=50%>$VALUE</td>
</tr>
";
}
@keywords=$query->param;
foreach $keyword (@keywords) {
$VALUE=$query->param($keyword);
$VALUE='<empty>' if (!$VALUE);
print "
<tr>
<td width=30%># $keyword</td>
<td width=50%>$VALUE</td>
</tr>
";
}
print <<EOF;
</table>
</body>
</html>
EOF
exit;
On Monday 08 October 2001 2:03 pm, alex.tesi wrote:
> Hi
> i'd like to make a cookies and read that cookies from al page of my site.
> Any of you can help me?
>
> Thankyou by AlexTesi
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]