File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed
Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -225,22 +225,6 @@ the existence of data in the session. This may hurt your application performance
225225because all users will receive a session cookie. In order to prevent that, you
226226must *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-
244228More about Sessions
245229-------------------
246230
You can’t perform that action at this time.
0 commit comments