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.