laravel COOKIE获取和设置

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
上一篇:SQL 收回查看所有库权限及更改库拥有者


下一篇:解决idea登录github出现的invalid authentication data 404 not found