简体   繁体   中英

how can I set an array in cookie? - laravel 5

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM