Skip to content

Commit d23c198

Browse files
author
Francesco Marangi
committed
#15205: Postpone instantiation of session config by using a proxy
1 parent 00c6b48 commit d23c198

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@
233233
<argument name="pathInfoProcessor" xsi:type="object">Magento\Backend\App\Request\PathInfoProcessor\Proxy</argument>
234234
</arguments>
235235
</type>
236+
<type name="Magento\Framework\App\Response\Http">
237+
<arguments>
238+
<argument name="sessionConfig" xsi:type="object">Magento\Framework\Session\Config\ConfigInterface\Proxy</argument>
239+
</arguments>
240+
</type>
236241
<preference for="Magento\Framework\Session\SaveHandlerInterface" type="Magento\Framework\Session\SaveHandler" />
237242
<type name="Magento\Framework\Session\SaveHandlerFactory">
238243
<arguments>

lib/internal/Magento/Framework/App/Response/Http.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ public function __construct(
7171
CookieMetadataFactory $cookieMetadataFactory,
7272
Context $context,
7373
DateTime $dateTime,
74-
ConfigInterface $sessionConfig = null
74+
ConfigInterface $sessionConfig
7575
) {
7676
$this->request = $request;
7777
$this->cookieManager = $cookieManager;
7878
$this->cookieMetadataFactory = $cookieMetadataFactory;
7979
$this->context = $context;
8080
$this->dateTime = $dateTime;
81-
$this->sessionConfig = $sessionConfig ?: ObjectManager::getInstance()->get(ConfigInterface::class);
81+
$this->sessionConfig = $sessionConfig;
8282
}
8383

8484
/**

0 commit comments

Comments
 (0)