Actually a better solution might be to use:
define('COOKIEPATH', preg_replace('|https://[^/]+|i', '', get_settings('siteurl') . '/' ) );
… since siteurl
is the path to the WP installation, which is probably the only place these cookies are set and used.
Does anyone know why cookie paths exist? Is this a security thing?