Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Revert "fixed example to check if the session exists when getting flash ...#2631
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…sh messages to avoid starting sessions when not needed"It seems that there may be something stored in the flash, but you never know, because the session isn't started, so you never check.This reverts commita5168ad.
weaverryan commentedMay 18, 2013
ping@Drak - could you offer me a little sanity check here :). I'd be reverting a PR of Fabien's, and you know more about sessions that anyone else. Thanks in advance! |
Revert "fixed example to check if the session exists when getting flash ...
TerjeBr commentedJul 15, 2013
This is what issue#6036 is all about why PR#6388 needs to be applied. Just checking if the session is started or not will not be right, because as you have noticed then the session may not start at all when it should be started. The test that needs to be done, is a test if the session has been started in a previous request/response exchange. PR#6388 add that test to the session interface, and what is more, it automatically applies it for you so no session is actually started if you only read from a session bag or a flash bag. That would make it so much easier for the application programmer. |
Hi guys!
This reverts#2564. In that issue, I made a comment:
I apologize if I'm missing something, but it seems that thisis a problem. I've tested locally (and had a training group that hit this) and with the new
ifstatement, 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!