52 parent::__construct($context);
55 if (!$this->_currentStore instanceof \
Magento\Store\Model\Store) {
56 throw new \InvalidArgumentException(
'Required store object is invalid');
61 if (!$this->_website instanceof \
Magento\Store\Model\Website) {
62 throw new \InvalidArgumentException(
'Required website object is invalid');
75 empty($acceptedSaveCookiesWebsites[$this->_website->getId()]);
86 return $this->scopeConfig->getValue(
87 self::XML_PATH_COOKIE_RESTRICTION,
88 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
101 $acceptedSaveCookiesWebsites[(int)$this->_website->getId()] = 1;
102 return json_encode($acceptedSaveCookiesWebsites);
112 $unSerializedList =
null;
113 $serializedList = $this->_request->getCookie(self::IS_USER_ALLOWED_SAVE_COOKIE,
false);
114 if ($serializedList) {
115 $unSerializedList = json_decode($serializedList,
true);
117 return is_array($unSerializedList) ? $unSerializedList : [];
127 return (
int)$this->scopeConfig->getValue(
128 self::XML_PATH_COOKIE_RESTRICTION_LIFETIME,
129 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
const XML_PATH_COOKIE_RESTRICTION_LIFETIME
const IS_USER_ALLOWED_SAVE_COOKIE
getCookieRestrictionLifetime()
_getAcceptedSaveCookiesWebsites()
getAcceptedSaveCookiesWebsiteIds()
isCookieRestrictionModeEnabled()
const XML_PATH_COOKIE_RESTRICTION
isUserNotAllowSaveCookie()
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data=[])