Solve this error: yii\web\Request::cookieValidationKey must be configured with a secret key.

Do you get this error with Yii2:

Invalid Configuration – yii\base\InvalidConfigException

yii\web\Request::cookieValidationKey must be configured with a secret key.

In this tutorial I will explain to you how you can solve this error. Yii Framework 2.0 ask you to insert a secret key. This is required by cookie validation.

To solve this error, open your config/web.php file and you must insert a secret key on cookieValidationKey.

You can add any type of key you want:

'cookieValidationKey' => '',

For example I have insert a key like: xyctuyvibonp

'cookieValidationKey' => 'xyctuyvibonp',

In this way you can solve this error!

Now you can start to use Yii Framework 2.0.









Leave a Comment