Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CookieMetadataFactory.php
Go to the documentation of this file.
1 <?php
8 
10 
17 {
21  private $objectManager;
22 
26  public function __construct(ObjectManagerInterface $objectManager)
27  {
28  $this->objectManager = $objectManager;
29  }
30 
37  public function createSensitiveCookieMetadata($metadata = [])
38  {
39  return $this->objectManager->create(
40  \Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class,
41  ['metadata' => $metadata]
42  );
43  }
44 
51  public function createPublicCookieMetadata($metadata = [])
52  {
53  return $this->objectManager->create(
54  \Magento\Framework\Stdlib\Cookie\PublicCookieMetadata::class,
55  ['metadata' => $metadata]
56  );
57  }
58 
65  public function createCookieMetadata($metadata = [])
66  {
67  return $this->objectManager->create(
68  \Magento\Framework\Stdlib\Cookie\CookieMetadata::class,
69  ['metadata' => $metadata]
70  );
71  }
72 }
$objectManager
Definition: bootstrap.php:17