laravel COOKIE 获取
use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie; class TaskController extends Controller { // public function index(){ return "index"; } public function cookiess(){ //return request()->cookie('laravel_session'); return Cookie::get('laravel_session'); //return 11; } } laravel COOKIE 设置
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie; class TaskController extends Controller { // public function index(){ return "index"; } public function cookiess(){ //return request()->cookie('laravel_session'); //return Cookie::get('laravel_session'); //return 11; //return response('dada')->cookie('age',10,5); Cookie::queue('nae',10,19); } } 文章来自 www.sxlenovo.com