cookieManager = $cookieManager; $this->cookieMetadataFacory = $cookieMetadataFactory; $this->_response = $context->getResponse(); $this->request = $context->getRequest(); } /** * Retrieve cookie metadata factory */ protected function getCookieMetadataFactory() { return $this->cookieMetadataFacory; } /** * Retrieve cookie metadata factory */ protected function getCookieManager() { return $this->cookieManager; } /** * Dispatch request * * @param RequestInterface $request * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { $this->request = $request; $result = $this->execute(); return $result ? $result : $this->_response; } }