For example, if a handler wants to return a 404 response, but nevertheless to set a cookie, it has to be: $r->err_headers_out->add('Set-Cookie' => $cookie); return Apache2::Const::NOT_FOUND; If the handler does: $r->headers_out->add('Set-Cookie' => $cookie); return Apache2::Const::NOT_FOUND; the C header won't be sent.