I am trying to set a cookie in laravel 5 using the standard method

Cookie::make('room_1', $data, $minutes); 

But unfortunately this does not work, I tried to add a queue to the queue.

 Cookie::queue('room_1', $data, $minutes); 

It worked, but I still want to know why make does not work, I launch it in the controller when the page loads

    1 answer 1

    Make only installs a cookie, and still need to transfer to the client, for example:

     $cookie = Cookie::make('room_1', $data, $minutes); return $response()->withCookie(cookie($cookie)); 

    The same can be done like this:

     $cookie = Cookie::queue('room_1', $data, $minutes); return $response();