##存入cookieYii::$app->response->cookies->add(new \yii\web\cookie([ 'name'=>'username', 'value'=>'zhansan' ]));
#获取cookie Yii::$app->request->cookies->get('username');
注:cookie在浏览器内被加密了,调试时,不能exit和die,不然不能写入