Node.js examples for Environment:Cookie
Create cookie by name, value and days
function createCookie(name, value, days) { var expires; /*from w ww .ja v a 2 s . c o m*/ if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toGMTString(); } else expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; }