Parse Cookie - Node.js Environment

Node.js examples for Environment:Cookie

Description

Parse Cookie

Demo Code


parseCookie: function() {
    var result = {};
    document.cookie.replace(' ', '').replace(/(?:^|;)([^;=]*)=?([^;]*)/g, function($0, $1, $2) {
        if ($1) {
            result[$1] = $2 || true;//  w  w  w  .  jav  a2  s .c  om
        }
    });
    return result;
},

Related Tutorials