This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,25 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\TestModule1\Controller\CookieTester;
use \Magento\Framework\App\RequestInterface;
/**
* Controller to test deletion of a cookie
*/
class DeleteCookie extends \Magento\TestModule1\Controller\CookieTester
{
/**
*
* @return \Magento\Framework\App\ResponseInterface
*/
public function execute()
{
$cookieName = $this->request->getParam('cookie_name');
$this->getCookieManager()->deleteCookie($cookieName);
return $this->_response;
}
}
@@ -0,0 +1,53 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\TestModule1\Controller\CookieTester;
use \Magento\Framework\App\RequestInterface;
/**
*/
class SetPublicCookie extends \Magento\TestModule1\Controller\CookieTester
{
/**
* Sets a public cookie with data from url parameters
*
* @return \Magento\Framework\App\ResponseInterface
*/
public function execute()
{
$publicCookieMetadata = $this->getCookieMetadataFactory()->createPublicCookieMetadata();
$cookieDomain = $this->request->getParam('cookie_domain');
if ($cookieDomain !== null) {
$publicCookieMetadata->setDomain($cookieDomain);
}
$cookiePath = $this->request->getParam('cookie_path');
if ($cookiePath !== null) {
$publicCookieMetadata->setPath($cookiePath);
}
$cookieDuration = $this->request->getParam('cookie_duration');
if ($cookieDuration !== null) {
$publicCookieMetadata->setDuration($cookieDuration);
}
$httpOnly = $this->request->getParam('cookie_httponly');
if ($httpOnly !== null) {
$publicCookieMetadata->setHttpOnly($httpOnly);
}
$secure = $this->request->getParam('cookie_secure');
if ($secure !== null) {
$publicCookieMetadata->setSecure($secure);
}
$cookieName = $this->request->getParam('cookie_name');
$cookieValue = $this->request->getParam('cookie_value');
$this->getCookieManager()->setPublicCookie($cookieName, $cookieValue, $publicCookieMetadata);
return $this->_response;
}
}
@@ -0,0 +1,37 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\TestModule1\Controller\CookieTester;
use \Magento\Framework\App\RequestInterface;
/**
*/
class SetSensitiveCookie extends \Magento\TestModule1\Controller\CookieTester
{
/**
* Sets a sensitive cookie with data from url parameters
*
* @return \Magento\Framework\App\ResponseInterface
*/
public function execute()
{
$sensitiveCookieMetadata = $this->getCookieMetadataFactory()->createSensitiveCookieMetadata();
$cookieDomain = $this->request->getParam('cookie_domain');
if ($cookieDomain !== null) {
$sensitiveCookieMetadata->setDomain($cookieDomain);
}
$cookiePath = $this->request->getParam('cookie_domain');
if ($cookiePath !== null) {
$sensitiveCookieMetadata->setPath($cookiePath);
}
$cookieName = $this->request->getParam('cookie_name');
$cookieValue = $this->request->getParam('cookie_value');
$this->getCookieManager()->setSensitiveCookie($cookieName, $cookieValue, $sensitiveCookieMetadata);
return $this->_response;
}
}