【发布时间】:2021-12-08 06:06:11
【问题描述】:
我在使用请求之间的中间件中传递一个 cookie
$cookie = Cookie::make('key', 'some-key, 10);
$next = $next($request);
$next->withCookie($cookie);
但是在我检索到它的值后从 $request 中删除 cookie 时遇到问题。我在文档中找不到任何命令或助手来实现这一点。
【问题讨论】:
我在使用请求之间的中间件中传递一个 cookie
$cookie = Cookie::make('key', 'some-key, 10);
$next = $next($request);
$next->withCookie($cookie);
但是在我检索到它的值后从 $request 中删除 cookie 时遇到问题。我在文档中找不到任何命令或助手来实现这一点。
【问题讨论】:
您不能强制所有客户端删除 cookie。您可以做的是将 cookie 值设置为空字符串并设置较短的到期时间。
【讨论】: