title: How to queue cookies in lumen?
body: <p>I am trying to queue various cookies in response in Lumen.</p>
  
  <p>I've added <code>\Illuminate\Cookie\</code> into my Composer.</p>
  
  <p>I added Following code in <code>app.php</code></p>
  
  <pre><code>$app-&gt;singleton('cookie', function () use ($app) {
      return $app-&gt;loadComponent('session', 'Illuminate\Cookie\CookieServiceProvider', 'cookie');
  });
  
  $app-&gt;bind('Illuminate\Contracts\Cookie\QueueingFactory', 'cookie');
  </code></pre>
  
  <p>In My Controller, I am trying the following code</p>
  
  <pre><code>Cookie::queue(Cookie::make('test', 'tada', 10, '/'));
  //Few more business logic here: before returning the response
  $response = new \Illuminate\Http\Response('exit');
  return $response-&gt;withHeaders($headers);
  </code></pre>
  
  <p>I can see my queued cookies using <code>Cookie::getQueuedCookies()</code></p>
  
  <p>but still, after a response, my cookie is nowhere to be found.
  I tried various answers from StackOverflow questions but still couldn't resolve it</p>
  
  <p>I can't use <code>response()-&gt;withCookie()</code> solution because I am creating cookies at various points of my code, and can't pull them together at the time of response</p>