Sha256: 51a0996c44148affc91fd0db0fefd63daf33c46d16318f4f775208f6bc0edc85

Contents?: true

Size: 694 Bytes

Versions: 26

Compression:

Stored size: 694 Bytes

Contents

/*!
 * Ext JS Connect
 * Copyright(c) 2010 Sencha Inc.
 * MIT Licensed
 */

/**
 * Module dependencies.
 */

var utils = require('./../utils');

/**
 * Parse _Cookie_ header and populate `req.cookies`.
 *
 * @return {Function}
 * @api public
 */

module.exports = function cookieDecoder(){
    return function cookieDecoder(req, res, next) {
        var cookie = req.headers.cookie;
        req.cookies = {};
        if (cookie) {
            try {
                req.cookies = utils.parseCookie(cookie);
                delete req.headers.cookie;
            } catch (err) {
                // Ignore
            }
            next();
        } else {
            next();
        }
    };
};

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
vulcan-0.8.2 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.8.1 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.8.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.7.2 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.7.1 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.7.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.6.1 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.6.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.5.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.4.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.3.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.2.5 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.2.4 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.2.3 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.2.2 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.2.1 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.2.0 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.1.6 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.1.5 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js
vulcan-0.1.4 server/node_modules/connect-form/support/connect/lib/connect/middleware/cookieDecoder.js