在构造方法中获取Cookie为加密值,请问如何转化为未加密值
public function __construct()
{
echo Cookie::get('customer_id');
// 打印结果
// eyJpdiI6Im5NZVNkTnpJSlFib3BpXC91VmdHWFJ....
}
public function index()
{
echo Cookie::get('customer_id');
// 打印结果
// 6
}
2 回答
LEATH
TA贡献1936条经验 获得超6个赞
private $cookies = [];
public function __construct()
{
$this->cookies['customer_id'] = 解码方法(Cookie::get('customer_id'));
}
public function index()
{
echo $this->cookies['customer_id'];
}
- 2 回答
- 0 关注
- 532 浏览
添加回答
举报
0/150
提交
取消