I saw the data in express api reference
expressjs api reference for cookie
in the document, cookie can send as JSON res.cookie('cart', { items: [1,2,3] });
so I started to try, cookie worked well when I use string, but not in JSON format.
res.cookie('cookietmp',{test: ['test1', 'test2']}, { maxAge: 900000, httpOnly: true});
res.send('test cookie: ' + req.cookies.cookietmp)
this is my code
and my browser display
test cookie: [object Object]
it seems like my browser doesn't know the format is JSON or something, how can I solve it?