Skip to content

Commit e935949

Browse files
Francesco Marangihitesh-wagento
Francesco Marangi
authored andcommitted
#15205: Postpone instantiation of session config by using a proxy
1 parent 02aaccb commit e935949

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
@@ -273,6 +273,11 @@
273273
<argument name="pathInfoProcessor" xsi:type="object">Magento\Backend\App\Request\PathInfoProcessor\Proxy</argument>
274274
</arguments>
275275
</type>
276+
<type name="Magento\Framework\App\Response\Http">
277+
<arguments>
278+
<argument name="sessionConfig" xsi:type="object">Magento\Framework\Session\Config\ConfigInterface\Proxy</argument>
279+
</arguments>
280+
</type>
276281
<preference for="Magento\Framework\Session\SaveHandlerInterface" type="Magento\Framework\Session\SaveHandler" />
277282
<type name="Magento\Framework\Session\SaveHandlerFactory">
278283
<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)