-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Twig Bridge] Getting flashes should start the session #25073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree, this was a workaround that prevented starting the session when "just" checking for flashed, but now that the session is more lazy (since #24523), we could be more "correct" here. |
You can definitely PR a removal of the |
Hmm should I base it on master or 3.3? |
I'd go from 3.4, as sessions have been improved massively from this version (which allows us to remove this |
This PR was merged into the 3.4 branch. Discussion ---------- [Bridge/Twig] Let getFlashes starts the session | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? |no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25073 | License | MIT Commits ------- a27f959 Let getFlashes starts the session
In 5a56b23 you can see
app.flashes
returns an empty array if the session hasn't started. Reading http://symfony.com/doc/current/session/avoid_session_start.html this seems really weird to me; this means I have to addapp.session.start()
after checking forapp.request.hasPreviousSession
if I want to make sure any flash is displayed.Is this really wanted? If we must check for
app.request.hasPreviousSession
then reading flashes could start the session.The text was updated successfully, but these errors were encountered: