sub SetCookies { my (%input) = @_; while( my($name,$value) = each %input ) { my $c = CGI->cookie ( -name => $name, -value => $value, -expires => ((exists($cookie_config{expires}) && $cookie_config{expires} ==1) ? $cookie_config{expires} : undef), -domain => ((exists($cookie_config{domain}) && $cookie_config{domain} ==1) ? $cookie_config{domain} : undef), -secure => ((exists($cookie_config{secure}) && $cookie_config{secure} ==1) ? $cookie_config{secure} : undef), -path => ((exists($cookie_config{path}) && $cookie_config{path} ==1) ? $cookie_config{path} : undef), ); print "Set-Cookie: ", $c, "\n"; } }