Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Stdlib
Cookie
SensitiveCookieMetadata.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Stdlib\Cookie
;
8
9
use
Magento\Framework\App\RequestInterface
;
10
20
class
SensitiveCookieMetadata
extends
CookieMetadata
21
{
25
protected
$request
;
26
31
public
function
__construct
(
RequestInterface
$request
, $metadata = [])
32
{
33
if
(!isset($metadata[self::KEY_HTTP_ONLY])) {
34
$metadata[
self::KEY_HTTP_ONLY
] =
true
;
35
}
36
$this->request =
$request
;
37
parent::__construct($metadata);
38
}
39
43
public
function
getSecure
()
44
{
45
$this->updateSecureValue();
46
return
$this->
get
(
self::KEY_SECURE
);
47
}
48
52
public
function
__toArray
()
53
{
54
$this->updateSecureValue();
55
return
parent::__toArray();
56
}
57
63
private
function
updateSecureValue()
64
{
65
if
(
null
=== $this->
get
(self::KEY_SECURE)) {
66
$this->
set
(
self::KEY_SECURE
, $this->request->isSecure());
67
}
68
}
69
}
Magento\Framework\Stdlib\Cookie\CookieMetadata
Definition:
CookieMetadata.php:13
Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata\__construct
__construct(RequestInterface $request, $metadata=[])
Definition:
SensitiveCookieMetadata.php:31
Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata\$request
$request
Definition:
SensitiveCookieMetadata.php:25
Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata
Definition:
SensitiveCookieMetadata.php:20
Magento\Framework\Stdlib\Cookie\CookieMetadata\KEY_SECURE
const KEY_SECURE
Definition:
CookieMetadata.php:20
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
Magento\Framework\Stdlib\Cookie
Definition:
CookieMetadata.php:6
Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata\getSecure
getSecure()
Definition:
SensitiveCookieMetadata.php:43
Magento\Framework\Stdlib\Cookie\CookieMetadata\KEY_HTTP_ONLY
const KEY_HTTP_ONLY
Definition:
CookieMetadata.php:21
Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata\__toArray
__toArray()
Definition:
SensitiveCookieMetadata.php:52