I'm using ajax to post data to a controller. In this controller I would like to set a cookie - I am then trying to read the set cookie (for testing purposes).
\Cookie::make('test', 'test-value', 2);
var_dump(\Request::cookie('test'));
die();
But the above results in a null value. Where am I going wrong?
Also on a side note - is it possible to store an array of values in a cookie. Is there any limit on the size of the array?
dd($value)
instead