symfony/symfony-docs — pull request #2631 by weaverryan (2013-05-10 22:50:18+00:00)
Title: Revert "fixed example to check if the session exists when getting flash ...

Hi guys!

This reverts #2564. In that issue, I made a comment:

>
Before I merge this, I want to make sure I'm not missing something. Why would the following situation not cause a problem:
>
1) On one request, you set a value in the flashbag and redirect
2) On the next request, you check for app.session.started in Twig. There is a flash message in the session, but the session hasn't been started yet, so the message is not displayed.

I apologize if I'm missing something, but it seems that this *is* a problem. I've tested locally (and had a training group that hit this) and with the new `if` statement, the flash messages don't print unless you've explicitly started the session earlier in the request (e.g. by accessing the session in the controller).

Can someone verify one way or another? I don't think it's possible to lazily ask "is there something in the flashbag?" without actually starting the session to be sure.

Thanks!