From d64032a8d71603fa57943f134ceb7708e5222e6e Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov Date: Mon, 29 Jul 2019 14:58:17 -0500 Subject: [PATCH 1/2] MC-18718: store switcher set not unique version --- .../Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php index 8aed785641efe..31a17c921a5de 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php @@ -54,7 +54,7 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s ->setHttpOnly(false); $this->cookieManager->setPublicCookie( \Magento\Framework\App\PageCache\Version::COOKIE_NAME, - 'should_be_updated', + \uniqid('should_be_updated-'), $publicCookieMetadata ); } catch (\Exception $e) { From 03506487f64ee253e7206a1206dfa4f9c0f71108 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov Date: Tue, 30 Jul 2019 10:27:37 -0500 Subject: [PATCH 2/2] MC-18718: store switcher set not unique version --- .../Store/Model/StoreSwitcher/ManagePrivateContent.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php index 31a17c921a5de..66fbce08a8b3d 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php @@ -38,9 +38,12 @@ public function __construct( } /** + * Update version of private content on each store switch. + * * @param StoreInterface $fromStore store where we came from * @param StoreInterface $targetStore store where to go to * @param string $redirectUrl original url requested for redirect after switching + * * @return string redirect url * @throws CannotSwitchStoreException */ @@ -54,7 +57,7 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s ->setHttpOnly(false); $this->cookieManager->setPublicCookie( \Magento\Framework\App\PageCache\Version::COOKIE_NAME, - \uniqid('should_be_updated-'), + \uniqid('updated-', true), $publicCookieMetadata ); } catch (\Exception $e) {