samdark / yii2-minimal

Yii 2 minimal application template
Other
140 stars 33 forks source link

Add cookieValidationKey to request config #4

Closed iamsalnikov closed 10 years ago

iamsalnikov commented 10 years ago

When I create app using samdark/yii2-minimal template and try to run app, I get error:

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

In config/web.php I add config for request:

'request' => [
    // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
    'cookieValidationKey' => 'thisIsAKey',
],

After that there was no error.

samdark commented 10 years ago

The issue is valid but solution isn't the key should be unique for an application so either its generation should be automated as it's done in basic app or left as is.

iamsalnikov commented 10 years ago

Thanks for that pointed to my mistake. What if I add in composer.json to section post-create-project-cmd command "yii\\composer\\Installer::generateCookieValidationKey" and add commit to current pull-request? Or left as is?

samdark commented 10 years ago

Please do.

iamsalnikov commented 10 years ago

Done.

samdark commented 10 years ago

Thanks!