Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CustomerFlushFormKey.php
Go to the documentation of this file.
1 <?php
8 
12 
14 {
18  private $session;
19 
23  private $dataFormKey;
24 
31  public function __construct(Session $session, DataFormKey $dataFormKey)
32  {
33  $this->session = $session;
34  $this->dataFormKey = $dataFormKey;
35  }
36 
43  public function aroundExecute(FlushFormKey $subject, callable $proceed, ...$args)
44  {
45  $currentFormKey = $this->dataFormKey->getFormKey();
46  $proceed(...$args);
47  $beforeParams = $this->session->getBeforeRequestParams();
48  if (isset($beforeParams['form_key']) && $beforeParams['form_key'] === $currentFormKey) {
49  $beforeParams['form_key'] = $this->dataFormKey->getFormKey();
50  $this->session->setBeforeRequestParams($beforeParams);
51  }
52  }
53 }
aroundExecute(FlushFormKey $subject, callable $proceed,... $args)
__construct(Session $session, DataFormKey $dataFormKey)