How to set cookie using json response?
I noticed that for me, at least the following command is the only job that sets a cookie:
return Redirect::to('/') ->withCookie(Cookie::make('blog', $cookie_values, 1000));
Of course, if it was an ajax request, it would return the redirect target.
How can I translate this into ajax request and return json response with cookie?
source share