Skip to content

Commit daa0982

Browse files
author
Hayder Sharhan
committed
MAGETWO-50234: Transmission of Private Resources into a New Sphere ('Resource Leak')
- When persistent cookie is deleted, deletion process uses http-only also now.
1 parent b749f90 commit daa0982

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function deleteByCustomerId($customerId, $clearCookie = true)
289289
*/
290290
public function removePersistentCookie()
291291
{
292-
$cookieMetadata = $this->_cookieMetadataFactory->createCookieMetadata()
292+
$cookieMetadata = $this->_cookieMetadataFactory->createSensitiveCookieMetadata()
293293
->setPath($this->sessionConfig->getCookiePath());
294294
$this->_cookieManager->deleteCookie(self::COOKIE_NAME, $cookieMetadata);
295295
return $this;

app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ public function testAfterDeleteCommit()
9191
{
9292
$cookiePath = 'some_path';
9393
$this->configMock->expects($this->once())->method('getCookiePath')->will($this->returnValue($cookiePath));
94-
$cookieMetadataMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\CookieMetadata')
94+
$cookieMetadataMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata')
9595
->disableOriginalConstructor()
9696
->getMock();
9797
$cookieMetadataMock->expects($this->once())
9898
->method('setPath')
9999
->with($cookiePath)
100100
->will($this->returnSelf());
101101
$this->cookieMetadataFactoryMock->expects($this->once())
102-
->method('createCookieMetadata')
102+
->method('createSensitiveCookieMetadata')
103103
->will($this->returnValue($cookieMetadataMock));
104104
$this->cookieManagerMock->expects(
105105
$this->once()

0 commit comments

Comments
 (0)