I have a problem. So I create a cookie when user is not connected and tried to access an image. And I want to delete this cookie when user login to application. I created like this :
setcookie(self::COOKIE_NAME, $generatedToken, time() + self::COOKIE_LIFETIME_DAY * 86400, self::COOKIE_PATH, $_SERVER['HTTP_HOST']);
And the cookie is correct created, but when I tried to delete the cookie doesn't work.I tried like this :
setcookie(self::COOKIE_NAME, '', 1);
And like this :
unset($_COOKIE[self::COOKIE_NAME]);
setcookie(self::COOKIE_NAME, '', time() - 30);
And the same situation. Can you help me please ?