Skip to content

Commit 0f58b3e

Browse files
ACPT-1327
more session resetState resetting
1 parent 936dd10 commit 0f58b3e

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ public function __construct(
114114
);
115115
}
116116

117+
/**
118+
* @inheritDoc
119+
*/
120+
public function _resetState(): void
121+
{
122+
parent::_resetState();
123+
$this->_isFirstAfterLogin = null;
124+
$this->acl = null;
125+
}
126+
117127
/**
118128
* Refresh ACL resources stored in session
119129
*

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ public function __construct(
139139
}
140140
}
141141

142+
/**
143+
* @inheritDoc
144+
*/
145+
public function _resetState(): void
146+
{
147+
parent::_resetState();
148+
$this->_quote = null;
149+
$this->_store = null;
150+
$this->_order = null;
151+
}
152+
142153
/**
143154
* Retrieve quote model object
144155
*
@@ -154,7 +165,7 @@ public function getQuote()
154165
$this->_quote->setCustomerGroupId($customerGroupId);
155166
$this->_quote->setIsActive(false);
156167
$this->_quote->setStoreId($this->getStoreId());
157-
168+
158169
$this->quoteRepository->save($this->_quote);
159170
$this->setQuoteId($this->_quote->getId());
160171
$this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]);

app/code/Magento/Checkout/Model/Session.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,19 @@ public function __construct(
186186
->get(LoggerInterface::class);
187187
}
188188

189+
/**
190+
* @inheritDoc
191+
*/
192+
public function _resetState(): void
193+
{
194+
parent::_resetState();
195+
$this->_quote = null;
196+
$this->_customer = null;
197+
$this->_loadInactive = false;
198+
$this->isLoading = false;
199+
$this->_order = null;
200+
}
201+
189202
/**
190203
* Set customer data.
191204
*

app/code/Magento/Customer/Model/Session.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ public function getCustomerGroupId()
399399
public function _resetState(): void
400400
{
401401
$this->_customer = null;
402+
$this->_customerModel = null;
403+
$this->setCustomerId(null);
404+
$this->setCustomerGroupId($this->groupManagement->getNotLoggedInGroup()->getId());
402405
$this->_isCustomerIdChecked = null;
403406
parent::_resetState();
404407
}

lib/internal/Magento/Framework/Session/SessionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,6 @@ private function initIniOptions()
639639
public function _resetState(): void
640640
{
641641
session_write_close();
642-
$this->urlHostCache = [];
642+
static::$urlHostCache = [];
643643
}
644644
}

0 commit comments

Comments
 (0)