yii2 cookie技术

2022-03-25 20:36:29 浏览数 (2)

代码语言:javascript复制
<?php
namespace frontendcontrollers;
use Yii;
class IndexController extends yiiwebController
{
	
	public function actionSite()
	{
		$cookie=new yiiwebCookie([
			'name'=>"cyg",
			'value'=>'666666'
			]);
		Yii::$app->response->cookies->add($cookie);
		var_dump($_COOKIE);
	}

}

0 人点赞