in laravel, how can I set an array in cookie ?
for example :
$test = array(
'fname'=>'test',
'lname'=>'test'
);
$test = array(
'fname'=>'test',
'lname'=>'test'
);
$response->withCookie(cookie('name', $test, 60));
return $response;
From Laravel documentation.
Cookie::queue('array_name['.$id.']',1, 9999)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.