4
4
Avoid Starting Sessions for Anonymous Users
5
5
===========================================
6
6
7
- Sessions in Symfony applications are automatically started when they are necessary.
7
+ Sessions in Symfony applications are automatically started whenever they are necessary.
8
8
This includes writing in the user's session, creating a flash message and logging
9
9
in 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.
11
11
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
13
13
cookie 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:
15
15
16
16
.. code-block :: html+jinja
17
17
@@ -37,7 +37,7 @@ cookie. To avoid this behavior, add a check before trying to access the flash me
37
37
{% endif %}
38
38
39
39
Another 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
41
41
to that URL:
42
42
43
43
.. code-block :: yaml
@@ -51,4 +51,4 @@ to that URL:
51
51
anonymous : ~
52
52
53
53
This behavior is caused because in Symfony applications, anonymous users are
54
- technically authenticated, .
54
+ technically authenticated.
0 commit comments