cxqz520 2015-10-25 14:10:09 8467次浏览 3条回复 0 0 0

在使用yii的session函数时,报错

An Error occurred while handling another error:
exception 'yii\base\InvalidConfigException' with message 'yii\web\Request::cookieValidationKey must be configured with a secret key.' in D:\wamp\www\basic\vendor\yiisoft\yii2\web\Response.php:369
Stack trace: 

查了说是配置问题。我用的wamp,有的说在扩展中配置了php_openssl就好,然而配置了也还是错误。请问这是什么问题呀? 我的代码:

<?php
namespace app\controllers;
use yii\web\Controller;
use yii\web\Cookie;
class HelloController extends Controller{
    public function actionIndex()
    {

	$cookies = \YII::$app->response->cookies;
    }
}
您需要登录后才可以回复。登录 | 立即注册