Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ef19974

Browse filesBrowse files
committed
Fix session called initized several time
1 parent 8ef1826 commit ef19974
Copy full SHA for ef19974

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function onKernelRequest(GetResponseEvent $event)
5656
$session = null;
5757
$request = $event->getRequest();
5858
if (!$request->hasSession()) {
59-
$request->setSessionFactory(function () { return $this->getSession(); });
59+
$sess = null;
60+
$request->setSessionFactory(function () use (&$sess) { return $sess ?? $sess = $this->getSession(); });
6061
}
6162

6263
$session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.