简体   繁体   English

更新加密的Cookie Laravel 5.4

[英]Update encrypted Cookie laravel 5.4

I tried this 我试过了

$value = $request->cookie('AuthCookie');
$cookie->forget('AuthCookie');

$cookie->make('AuthCookie', $username, 44444);

But this does not update the cookie and it sometimes crashes. 但这不会更新cookie,有时会崩溃。

I am using 5.4 version of laravel. 我正在使用5.4版本的laravel。

You can resolve CookieJar singleton from the container by using: 您可以使用以下方法从容器中解决CookieJar单例:

$cookie = resolve('cookie');
$cookie->forget('AuthCookie');

References: 参考文献:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM