8000 Fix session called initized several time · symfony/symfony@ef19974 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef19974

Browse files
committed
Fix session called initized several time
1 parent 8ef1826 commit ef19974

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines 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