get(\Symfony\Component\HttpFoundation\RequestStack::class); $request = new \Symfony\Component\HttpFoundation\Request(); $request->cookies->set($cookieName, $cookieValue); $request->setSession( $this->get('session.factory')->createSession() ); $requestStack->push($request); return $requestStack; } }