diff --git a/templates/default/_flash_messages.html.twig b/templates/default/_flash_messages.html.twig index 7b078e62f..8d859f52e 100644 --- a/templates/default/_flash_messages.html.twig +++ b/templates/default/_flash_messages.html.twig @@ -5,19 +5,27 @@ A common practice to better distinguish between templates and fragments is to prefix fragments with an underscore. That's why this template is called '_flash_messages.html.twig' instead of 'flash_messages.html.twig' + + We check if we have session before reading flashes as it otherwise triggers session start: + https://symfony.com/doc/current/session/avoid_session_start.html + + TIP: With FOSHttpCache you can also adapt this to make it cache safe: + https://foshttpcachebundle.readthedocs.io/en/latest/features/helpers/flash-message.html #} -
+{% endif %}