title: Trying to set cookie in ajax call, Laravel
body: <p>I am trying to set a cookie in an ajax call, but can't get it to work.
  I have understood that I need to set it via setCookie on $response->headers.
  The $cookie variable looks correct, but no cookie is set in the browser.</p>
  
  <p>Code from my controller:  </p>
  
  <pre><code>$cookie = Cookie::make('testcookie', array('testvalue' =&gt; 'test'), 1000);  
  $response = Response::json(array('status' =&gt; 'ok'));  
  $response-&gt;headers-&gt;setCookie($cookie);  
  return $response;
  </code></pre>