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 7a327ce

Browse filesBrowse files
[FrameworkBundle] fix session-related BC layer triggering deprecation
1 parent d0140f5 commit 7a327ce
Copy full SHA for 7a327ce

File tree

1 file changed

+5
-2
lines changed
Filter options

1 file changed

+5
-2
lines changed

‎src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,14 @@ public function loginUser(object $user, string $firewallContext = 'main'): self
128128
$container = $this->getContainer();
129129
$container->get('security.untracked_token_storage')->setToken($token);
130130

131-
if (!$container->has('session') && !$container->has('session_factory')) {
131+
if ($container->has('session.factory')) {
132+
$session = $container->get('session.factory')->createSession();
133+
} elseif ($container->has('session')) {
134+
$session = $container->get('session');
135+
} else {
132136
return $this;
133137
}
134138

135-
$session = $container->get($container->has('session') ? 'session' : 'session_factory');
136139
$session->set('_security_'.$firewallContext, serialize($token));
137140
$session->save();
138141

0 commit comments

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