in reply to Trouble with cookies

You create the cookies, but never send them to the browser. Perhaps something like this:
print $q->header(-type=>'text/html', -cookie=>$cookie, -cookie=>$c +ookie1);

blokhead