Trouble deleting cookies within symfony Trouble deleting cookies within symfony symfony symfony

Trouble deleting cookies within symfony


You can also do

 $response = new Symfony\Component\HttpFoundation\Response(); $response->headers->clearCookie('nameOfTheCookie'); $response->send();

Don't forget to send the response back in the order that the cookie will be deleted


B default symfony set cookie with flag http only, that mean - you can`t delete cookie from js.for example:

$response->headers->setCookie(new Cookie('blabla', 'true', time() + (3600 * 48), '/', null, false, false));