Итак, я использовал библиотеку cookie
, внутренне используемую express ...
const cookie = require('cookie')
// ... inside route ...
let setCookie = cookie.serialize('name', value, {
expires: new Date(9999, 11, 31),
path: '/',
httpOnly: true,
secure: true,
domain: yourCookieDomain
})
setCookie += '; Priority=High'
res.append('Set-Cookie', setCookie)
Дает ...
set-cookie: name=value; Domain=foobar.com; Path=/; Expires=Fri, 31 Dec 9999 00:00:00 GMT; HttpOnly; Secure; Priority=High