Generally path should match to unset these cookies properly, e.g.:
setcookie('oc_username', '', time()-3600,  \OC::$WEBROOT);