<?php
namespace app\controller;
use think\Controller;
use think\facade\Cookie;
class testcookie extends Controller
{
public function index(){
Cookie
::init(
[
'prefix' =>'zcv_',
'expire' => 60*60*24*7,
]
);
Cookie
::set('user','bowenxu');
Cookie
::set('333','123',3600);
Cookie
::forever('foreveruse','admin');
echo '1.'.Cookie
::get('foreveruse');
echo Cookie
::has('333');
}
}
转载请注明原文地址:https://tech.qufami.com/read-18599.html