Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ContextPlugin.php
Go to the documentation of this file.
1 <?php
8 
14 use Magento\Framework\App\Http\Context as HttpContext;
15 
20 {
24  protected $customerSession;
25 
29  protected $httpContext;
30 
35  public function __construct(Session $customerSession, HttpContext $httpContext)
36  {
37  $this->customerSession = $customerSession;
38  $this->httpContext = $httpContext;
39  }
40 
50  {
51  $this->httpContext->setValue(
53  $this->customerSession->getCustomerGroupId(),
55  );
56  $this->httpContext->setValue(
58  $this->customerSession->isLoggedIn(),
59  false
60  );
61  }
62 }
return false
Definition: gallery.phtml:36
__construct(Session $customerSession, HttpContext $httpContext)
beforeDispatch(AbstractAction $subject, RequestInterface $request)