I do not know the error I am making when creating a class, but I can not delete the cookie with my class.
public function cookie($name, $value = 'nome', $expire = NULL, $path = '/', $domain = NULL, $secure = FALSE, $httponly = TRUE) {
setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
return $this;
}
public function delete($name){
unset($_COOKIE[$name]);
// empty value and expiration one hour before
setcookie($name, NULL, -1);
//return var_dump($_COOKIE);
}
$cs->cookie('meu', 'sd', time()+1800);
$cs->delete('meu');
I do not know why in my browser the cookie is not deleted, what am I doing wrong?