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 @@ -196,22 +196,6 @@ the existence of data in the session. This may hurt your application performance
196196because all users will receive a session cookie. In order to prevent that, you
197197must *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-
215199More about Sessions
216200-------------------
217201
You can’t perform that action at this time.
0 commit comments