Replies: 6 comments 37 replies
-
Hey @speller 👋🏻 |
Beta Was this translation helpful? Give feedback.
-
Converting into a discussion, since this is not a bug. |
Beta Was this translation helpful? Give feedback.
-
@rustatian I can do whatever I want. But how to make Symfony do this? That's the question. If out-of-the-box Symfony integration doesn't support sessions, this must be mentioned in the documentation. |
Beta Was this translation helpful? Give feedback.
-
Hello, can you dump the content of your |
Beta Was this translation helpful? Give feedback.
-
Very very interesting as I struggled with this over the weekend and it actually cost me an assessment I tried building with roadrunner. After much tinkering, it turns out that roadrunner is unable to recognise incoming sessions when there are multiple http workers in use. When reduced to 1, sessions work seamlessly. When increased (I was using 4), the worker that receives the request won't be the one request originated from, and simply send an empty session to the application Nb: I'm not using symfony but suphle. The superglobals are empty, so this isn't a matter of getCookieParams or psr. So the question now is how to get multiple http workers to share and recognise the same session objects coming in, irrespective of whether they were the ones to serve the outgoing request |
Beta Was this translation helpful? Give feedback.
-
The issue in our case was in the conjunction of the default session fixation strategy and the HTTP Basic authentication. With this type of authentication, every request is a successful login and Symfomy regenerates the session deleting old session data. I was not aware of this and was repeating the request from a debug proxy with the constant sessions id but this id was already invalidated and represented a destroyed session id so the session_start() PHP function didn't restore the session. I didn't dig deep into this issue. Just switched to another type of authentication. |
Beta Was this translation helpful? Give feedback.
-
No duplicates 🥲.
What happened?
Sessions in my Symfony are recreated on every request.
Version (rr --version)
2.12.2
How to reproduce the issue?
Not sure how to reproduce it.
Environment: local HTTP
Symfony version: 6.2.5
baldinof/roadrunner-bundle: 2.2.4
In the
\Baldinof\RoadRunnerBundle\Http\KernelHandler::handle()
method, the request contains the session id cookie:But there's no
$_COOKIE
arraySo when Symfony tries to start a session in
\Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::start()
, it tries to get the session id value from$_COOKIE
and gets nothing, creating a new session. How to fix this?I found only this relevant issue #18 but it's quite old and closed.
Relevant log output
No response
Beta Was this translation helpful? Give feedback.
All reactions