Hmm... well, I know unsetting a cookie is achieved with the following:
$cookie = Cookie::forget('key');
return Response::make('random reply')->withCookie($cookie);
but to do multiple, you could do this:
public function unsetCookies(Array $cookieList)
{
if(!empty($cookieList)) {
foreach($cookieList as $cookie) {
$this->headers->setCookie($cookie);
return $this;
}
}else {
return Redirect::back()->with('Error', 'No cookies have been given for hunting and destroying!');
}
}
In case anyone wanders in and wants to know, the answer is to make an array of the cookies and then use the withCookies method, which accepts an array as the parameter.
$cookie[0] = Cookie::forget('key1');
$cookie[1] = Cookie::forget('key2');
return Response::make('thisResponse')->withCookies($cookie);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community