Yii2 Error: cookieValidationKey Must be Configured With a Secret Key


To overcome this error, I added this code below in config/web.php

'components' => [
        'request' => [
            'enableCookieValidation' => true,
            'cookieValidationKey' => 'your-validation-key',
        ],
......

Hope it helps.

2 thoughts on “Yii2 Error: cookieValidationKey Must be Configured With a Secret Key

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s