Skip to content

Commit c005dd3

Browse files
committed
Merge branch '2.3' into 2.6
* 2.3: Minor rewording Fixed a minor grammar issue Minor rewording Fixed some typos Improved the explanation about the "secret" configuration parameter
2 parents 0b7f89b + 387ebc0 commit c005dd3

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

reference/configuration/framework.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,24 @@ secret
6969

7070
**type**: ``string`` **required**
7171

72-
This is a string that should be unique to your application. In practice,
73-
it's used for generating the CSRF tokens, but it could be used in any other
74-
context where having a unique string is useful. It becomes the service container
75-
parameter named ``kernel.secret``.
72+
This is a string that should be unique to your application and it's commonly used
73+
to add more entropy to security related operations. Its value should be a series of
74+
characters, numbers and symbols chosen randomly and the recommended length is
75+
around 32 characters.
76+
77+
In practice, Symfony uses this value for generating the :ref:`CSRF tokens <forms-csrf>`,
78+
for encrypting the cookies used in the :doc:`remember me functionality </cookbook/security/remember_me>`
79+
and for creating signed URIs when using :ref:`ESI (Edge Side Includes) <edge-side-includes>` .
80+
81+
This option becomes the service container parameter named ``kernel.secret``,
82+
which you can use whenever the application needs an immutable random string
83+
to add more entropy.
84+
85+
As with any other security-related parameter, it is a good practice to change this
86+
value from time to time. However, keep in mind that changing this value will
87+
invalidate all signed URIs and Remember Me cookies. That's why, after changing
88+
this value, you should regenerate the application cache and log out all the
89+
application users.
7690

7791
.. _configuration-framework-http_method_override:
7892

0 commit comments

Comments
 (0)