Skip to content

Commit 289d609

Browse files
magento/magento2-login-as-customer#186: [CE] Admin cannot login as customer in two different customers account
1 parent 74a48fd commit 289d609

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/LoginAsCustomerFrontendUi/Plugin/InvalidateExpiredSessionPlugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public function beforeExecute(ActionInterface $subject)
6161
$customerId = (int)$this->session->getCustomerId();
6262
if ($adminId && $customerId) {
6363
if (!$this->isLoginAsCustomerSessionActive->execute($customerId, $adminId)) {
64-
$this->session->destroy();
64+
$this->session->clearStorage();
65+
$this->session->expireSessionCookie();
66+
$this->session->regenerateId();
6567
}
6668
}
6769
}

0 commit comments

Comments
 (0)