set cookie in node

JavaScript
res.setHeader('Set-Cookie','visited=true; Max-Age=3000; HttpOnly, Secure');
Source

Also in JavaScript: