I need to create a cookie in my service
public function __construct(EntityManager $em, RequestStack $request)
{
parent::__construct();
$this->request = $request->getMasterRequest();
}
then when I try to call this somewhere inside my service:
echo $this->request->cookies->get('_ga');die;
I get cookie that's created manually by me, but calling ->set(key, val) doesn't save my cookie
$this->request->cookies->set('test', time());
echo $this->request->cookies->get('test');
I get time, but cookie only exists once, in scope of this webrequest, if I comment line with ->set then I should see time that isn't changing but I don't see it, because cookie isn't actually stored... any help?