# Create new cookies and send them my $cookie1 = new CGI::Cookie(-name=>'user_id',-value=>$username); print CGI::header(-cookie=>[$cookie1]); $cookie1->bake; #retrieving cookies my %cookies = raw_fetch CGI::Cookie; print %cookies; foreach (keys %cookies) { print ($cookies{$_}); }