As the title suggests,
Here's the code...
public function index(Request $request, Application $app)
{
$cookies = $request->cookies;
print_r($request->cookies);
if(!$cookies->has("recordsPerPage"))
{
$response = new Response();
$cookie = new Cookie("recordsPerPage", $app['defaultRecordsPerPage']);
$response->headers->setCookie($cookie);
}
print_r($request->cookies);exit; //prints nothing here !!
}
I also tried to set it in a $app->after()
but failed. do you have any other ways to set cookies other than in controller.
Thank you.