headers->setCookie(new Cookie($str, $str, 0, '', null, false, false, false, null)); $r->sendHeaders(); setcookie($str, $str, 0, '/');