I want to delete a cookie and it does not work.
Here is the code, any ideas?
setcookie("candidate_site_search", serialize($model->getAttributes()), strtotime('next year'), '/');
if (isset($_GET['clearFilters']) && ($_GET['clearFilters'] == 1)) {
//die('cf');
$model->unsetAttributes();
setcookie("candidate_site_search", serialize($model->getAttributes()), time() - 60 * 60 * 24 * 30);
if (isset($_COOKIE['candidate_site_search']))
unset($_COOKIE['candidate_site_search']);
if (isset($_COOKIE['site_search']))
unset($_COOKIE['site_search']);
$this->redirect(array('/candidate/search'));
}
After delete, i redirect to the same url from where the request came.
still nothing happens
p.s: I think this cookie is related to Chuck Norris, or at least Superman ...