2020-10-12 11:19:19 +08:00

19 lines
344 B
PHP

<?php
namespace app\middleware;
use think\facade\Session;
use think\facade\Cookie;
class LoginCookie
{
public function handle($request, \Closure $next)
{
//登陆前Cookie检测
if(Cookie::get('user_id')){
//dump(Cookie::get('user_id'));
Session::set('user_id',Cookie::get('user_id'));
}
return $next($request);
}
}