in reply to Extracting Cookies

The site I found that taught me is: http://www.cookiecentral.com/faq/
It covers cookie creation and removal (perl and other languages) and has other information about cookies.

To save you some time, here are the basics:
Setting a cookie:

print "Content-type: text/html\n"; print "Set-Cookie: foo=bar; path=/; expires=Mon, 01-Jan-2001 00:00:00 +GMT\n\n";
Reading a cookie:
@nvpairs=split(/; /, $ENV{'HTTP_COOKIE'}); foreach $pair (@nvpairs) { ($name, $value) = split(/=/, $pair); }

Use a read in cookie:
$cookie{$name} = $value;

Nowadays I use the CGI.pm module though. Much easier.
(Although I have run into a case where CGI.pm didn't work the way I needed it to.)