Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I safely change the APP_SECRET variable in Symfony 4? [duplicate]

In the parameters.yml file there is a parameter named secret which defaults to ThisTokenIsNotSoSecretChangeIt but it should be changed to something else.

What happens if the value of this parameter is changed in production? Can it break anything?

like image 981
Francesco Borzi Avatar asked Nov 17 '16 09:11

Francesco Borzi


1 Answers

It does not break anything. Changing the value secret parameter from time to time is even considered a good practice, suggested by the official documentation:

http://symfony.com/doc/current/reference/configuration/framework.html#secret

The only thing to be aware of is:

However, keep in mind that changing this value will invalidate all signed URIs and Remember Me cookies. That's why, after changing this value, you should regenerate the application cache and log out all the application users.

like image 94
Francesco Borzi Avatar answered Sep 18 '22 14:09

Francesco Borzi