Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
RefreshCustomerData Class Reference
Inheritance diagram for RefreshCustomerData:
ObserverInterface

Public Member Functions

 __construct (PhpCookieManager $cookieManager, CookieMetadataFactory $cookieMetadataFactory)
 
 execute (\Magento\Framework\Event\Observer $observer)
 
- Public Member Functions inherited from ObserverInterface
 execute (Observer $observer)
 

Detailed Description

Definition at line 12 of file RefreshCustomerData.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( PhpCookieManager  $cookieManager,
CookieMetadataFactory  $cookieMetadataFactory 
)

RefreshCustomerData constructor.

Parameters
PhpCookieManager$cookieManager
CookieMetadataFactory$cookieMetadataFactory

Definition at line 29 of file RefreshCustomerData.php.

32  {
33  $this->cookieManager = $cookieManager;
34  $this->cookieMetadataFactory = $cookieMetadataFactory;
35  }

Member Function Documentation

◆ execute()

execute ( \Magento\Framework\Event\Observer  $observer)

Check and clear session data if persistent session expired

Parameters
\Magento\Framework\Event\Observer$observer
Returns
void @SuppressWarnings(PHPMD.UnusedFormalParameter)

Definition at line 44 of file RefreshCustomerData.php.

45  {
46  if ($this->cookieManager->getCookie('mage-cache-sessid')) {
47  $metadata = $this->cookieMetadataFactory->createCookieMetadata();
48  $metadata->setPath('/');
49  $this->cookieManager->deleteCookie('mage-cache-sessid', $metadata);
50  }
51  }

The documentation for this class was generated from the following file: