【发布时间】:2016-04-30 00:38:27
【问题描述】:
我正在使用 Laravel 5.1,我正在尝试实现基本的 JWT-Auth 逻辑。
虽然我正在创建 jwt_token 权限(我将其记录到 laravel.log,令牌有它按预期由点划分的三个不同部分),当我尝试使用 jwt_token 值创建一个 cookie 时,a创建了完全不同的 cookie,没有被点分割,它比原来的 jwt_token 大得多。
我认为代码非常简单:
$jwt_token = $this->findOrCreateUser($user);
Log::error('My jwt_token is '. $jwt_token); //from the log here i see the right jwt_token
//i disable the http-only flag because i want to read it with js
return redirect('/index.html')->withCookie(Cookie::make('jwt_token',$jwt_token,1000,null,null,false,false));
如果有人能给我一些关于可能出错的指示,我会很高兴!
谢谢
【问题讨论】: