Laravel的cookies读取后是加密的该如何解密?laravel默认存储cookies都是加密的,故此为了安全期间一般非授权name值都是加密的。
作者:任聪聪
日期:2023年12月17日文章转载自:Laravel的cookies读取后是加密的该如何解密? – 任聪聪博客 (rccblogs.com) 【已获作者同意】
解决办法
文件路径:app\Http\Middleware\EncryptCookies.php
<?php namespace App\Http\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ // 'your_cookies_name' ]; }