Save cookie - Node.js Environment

Node.js examples for Environment:Cookie

Description

Save cookie

Demo Code

var EXPIRES = 'Sun, 24-Mar-2024 11:11:11 GMT';
window.saveCookie = saveCookie;/* w  w  w .j  ava 2  s.c  o  m*/
function saveCookie(k, v, expires){
    expires = expires || EXPIRES;
    document.cookie = (k+'='+v+'; expires='+expires+';');
    return v;
}

window.cookieKV = fromKV(document.cookie, '; ');

})();

Related Tutorials