Reputation: 73
With my current configuration, inside a controller $this->getRequest()->getSession()->getFlashBag()
always returns a FlashBag instance.
I see in the documentation that there is an AutoExpireFlashBag class that automatically expires messages, whether consumed or not.
How do I get Symfony to use that class instead of the regular FlashBag class ?
Thanks!
Upvotes: 2
Views: 848
Reputation: 13340
It is set by a global parameter in config file. You need just rename class for flashbag in session.flashbag.class
parameter. It is defined in https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml#L9. But you can override it in your configs.
Upvotes: 3