Skip to content

Fix remove dot profilekey #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: beta
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions Model/PersonalMerchandisingConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,25 @@
use Magento\Framework\Stdlib\Cookie\PublicCookieMetadata;
use Magento\Store\Model\Store;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Math\Random;

class PersonalMerchandisingConfig extends Config
{
/**
* Constructor.
*
* @param ScopeConfigInterface $config
* @param Json $jsonSerializer
* @param RequestInterface $request
* @param State $state
* @param WriterInterface $configWriter
* @param TypeListInterface $cacheTypeList
* @param CookieManagerInterface $cookieManager
* @param CookieMetadataFactory $cookieMetadataFactory
* @param Random $mathRandom
*
* @throws LocalizedException
*/
public function __construct(
ScopeConfigInterface $config,
Json $jsonSerializer,
Expand All @@ -25,7 +41,8 @@ public function __construct(
WriterInterface $configWriter,
TypeListInterface $cacheTypeList,
private readonly CookieManagerInterface $cookieManager,
private readonly CookieMetadataFactory $cookieMetadataFactory
private readonly CookieMetadataFactory $cookieMetadataFactory,
private readonly Random $mathRandom
) {
parent::__construct($config, $jsonSerializer, $request, $state, $configWriter, $cacheTypeList);
}
Expand Down Expand Up @@ -81,6 +98,6 @@ private function getCookieMetadata(): PublicCookieMetadata
*/
private function generateProfileKey(): string
{
return uniqid('', true);
return $this->mathRandom->getUniqueHash();
}
}
Loading