Skip to content

Commit a108e59

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [Session] Remove some unneeded example
2 parents 0a225a0 + fc14136 commit a108e59

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

session.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,6 @@ the existence of data in the session. This may hurt your application performance
225225
because all users will receive a session cookie. In order to prevent that, you
226226
must *completely* avoid accessing the session.
227227

228-
For example, if your templates include some code to display the
229-
:ref:`flash messages <flash-messages>`, sessions will start even if the user
230-
is not logged in and even if you haven't created any flash messages. To avoid
231-
this behavior, add a check before trying to access the flash messages:
232-
233-
.. code-block:: html+twig
234-
235-
{# this check prevents starting a session when there are no flash messages #}
236-
{% if app.request.hasPreviousSession %}
237-
{% for message in app.flashes('notice') %}
238-
<div class="flash-notice">
239-
{{ message }}
240-
</div>
241-
{% endfor %}
242-
{% endif %}
243-
244228
More about Sessions
245229
-------------------
246230

0 commit comments

Comments
 (0)