I've install Yii2 framework using composer but get this error in my browser (on localhost):
Invalid Configuration – yii\base\InvalidConfigException
yii\web\Request::cookieValidationKey must be configured with a secret key.
How can I solve this problem?
There is this problem with basic app now https://github.com/yiisoft/yii2-app-basic/issues/69 where composer install
doesn't generate this key.
You need to add this key manually.
'cookieValidationKey' => '',
to include random string (you can use anything like 'cookieValidationKey' => 'jfsbkjsbfdskjgfdskjbgfsdhjgfajds',
You need to set cookieValidationKey
in the config file to a random string. The config file is located under yii/your-projectfolder/config/main-local.php
if you are using Yii 2.0 Advanced Template
You need to set cookieValidationKey
value in project/config/web.php
at line 12.
change at:
'cookieValidationKey' => '',
replace with:
'cookieValidationKey' => 'setyourkey',
That should address the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With