Add COOKIEPATH and COOKIE_DOMAIN. See #1257.