Symfony2 : Read Cookie Symfony2 : Read Cookie symfony symfony

Symfony2 : Read Cookie


You must read cookies on the Request object, not on the void Response object you just created ;)

public function testReadCookieAction(Request $request){    $cookies = $request->cookies;    if ($cookies->has('SYMFONY2_TEST'))    {        var_dump($cookies->get('SYMFONY2_TEST'));    }}