44Avoid Starting Sessions for Anonymous Users
55===========================================
66
7- Sessions in Symfony applications are automatically started when they are necessary.
7+ Sessions in Symfony applications are automatically started whenever they are necessary.
88This includes writing in the user's session, creating a flash message and logging
99in users. In order to start the session, Symfony creates a cookie which will be
10- sent for every request.
10+ added to every user request.
1111
12- However, there are other scenarios when a session is started and therefore, a
12+ However, there are other scenarios when a session is started automatically and a
1313cookie will be created even for anonymous users. First, consider the following
14- code commonly used to display flash messages:
14+ template code commonly used to display flash messages:
1515
1616.. code-block :: html+jinja
1717
@@ -37,7 +37,7 @@ cookie. To avoid this behavior, add a check before trying to access the flash me
3737 {% endif %}
3838
3939Another scenario where session cookies will be automatically sent is when the
40- requested URL is covered by a firewall, no matter if anonymous users can access
40+ requested URL is covered by a firewall, even when anonymous users can access
4141to that URL:
4242
4343.. code-block :: yaml
@@ -51,4 +51,4 @@ to that URL:
5151 anonymous : ~
5252
5353 This behavior is caused because in Symfony applications, anonymous users are
54- technically authenticated, .
54+ technically authenticated.
0 commit comments