aboutsummaryrefslogtreecommitdiff
path: root/core/cookies.js
blob: c51380e07b948ba8c54b3807e82d52f089a804e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
module.exports = (request) => {
    var list = {},
        rc = request.headers.cookie;
    
    rc && rc.split(';').forEach(function( cookie ) {
        var parts = cookie.split('=');
        list[parts.shift().trim()] = decodeURI(parts.join('='));
    });
    
    return list;
}