Skip to content

Commit fc14136

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [Session] Remove some unneeded example
2 parents 5641aa9 + 8bfa680 commit fc14136

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
@@ -196,22 +196,6 @@ the existence of data in the session. This may hurt your application performance
196196
because all users will receive a session cookie. In order to prevent that, you
197197
must *completely* avoid accessing the session.
198198

199-
For example, if your templates include some code to display the
200-
:ref:`flash messages <flash-messages>`, sessions will start even if the user
201-
is not logged in and even if you haven't created any flash messages. To avoid
202-
this behavior, add a check before trying to access the flash messages:
203-
204-
.. code-block:: html+twig
205-
206-
{# this check prevents starting a session when there are no flash messages #}
207-
{% if app.request.hasPreviousSession %}
208-
{% for message in app.flashes('notice') %}
209-
<div class="flash-notice">
210-
{{ message }}
211-
</div>
212-
{% endfor %}
213-
{% endif %}
214-
215199
More about Sessions
216200
-------------------
217201

0 commit comments

Comments
 (0)