how to remove a cookie from the $request in Laravel

Viewed 20

I am passing a cookie in the middleware between requests using

$cookie = Cookie::make('key', 'some-key, 10);
$next = $next($request);
$next->withCookie($cookie);

But am having problem removing the cookie from the $request after I retrieve its value. I can't find any command or helper in the docs to achieve this.

1 Answers

You cannot enforce all clients to delete a cookie. What you can do is set the cookie value to an empty string and set a short expiry time.

Related