64. cookie

tech2024-10-17  13

<?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'); //打上delete //Cookie::delete('333'); //全部打上delete //Cookie::clear('zcv_'); echo Cookie::has('333'); } }
最新回复(0)