Skip to content

Commit 01eb682

Browse files
committed
Fix issue with logging each cookie as separate context
1 parent b941603 commit 01eb682

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/internal/Magento/Framework/Stdlib/Cookie/PhpCookieManager.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ private function checkAbilityToSendCookie($name, $value)
212212
if ($numCookies > static::MAX_NUM_COOKIES) {
213213
$this->logger->warning(
214214
new Phrase('Unable to send the cookie. Maximum number of cookies would be exceeded.'),
215-
array_merge($_COOKIE, ['user-agent' => $this->httpHeader->getHttpUserAgent()])
215+
[
216+
'cookies' => $_COOKIE,
217+
'user-agent' => $this->httpHeader->getHttpUserAgent()
218+
]
216219
);
217220
}
218221

lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ public function testSetTooManyCookies()
565565
->method('warning')
566566
->with(
567567
new Phrase('Unable to send the cookie. Maximum number of cookies would be exceeded.'),
568-
array_merge($_COOKIE, ['user-agent' => $userAgent])
568+
[
569+
'cookies' => $_COOKIE,
570+
'user-agent' => $userAgent
571+
]
569572
);
570573

571574
$this->cookieManager->setPublicCookie(

0 commit comments

Comments
 (0)