Skip to content

Commit 92093b9

Browse files
authored
Change incorrect check for the stateless request attribute
We only want to use the session if the request is **not** `stateless`. The old code used the sesison only in `stateless` requests (so requests not intended to use the session (=state) at all).
1 parent ea760e7 commit 92093b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function searchBarAction(Request $request): Response
180180
$this->cspHandler?->disableCsp();
181181

182182
$session = null;
183-
if ($request->attributes->getBoolean('_stateless') && $request->hasSession()) {
183+
if (!$request->attributes->getBoolean('_stateless') && $request->hasSession()) {
184184
$session = $request->getSession();
185185
}
186186

0 commit comments

Comments
 (0)