if ($res->{res}) { my $MAC = Digest::SHA1::sha1_hex($ARGS{username}, "Get the S1gnal!"); my $cookie = Apache2::Cookie->new ( $r, -name => 'user_login', -value => { user_id => $ARGS{username}, MAC => $MAC }, -path => '/', -domain => 'ruth.dobson.net', -expires => '+1M', ); $r->err_headers_out->add('Set-Cookie' => $cookie); }