lib/pxcookie.js
function pxCookieFactory(ctx, config) {
    if (ctx.cookieOrigin === 'cookie') {
        return (ctx.cookies['_px3'] ? new CookieV3(ctx, config, config.logger) : new CookieV1(ctx, config, config.logger));
    } else {
        return (ctx.cookies['_px3'] ? new TokenV3(ctx, config, ctx.cookies['_px3'], config.logger) : new TokenV1(ctx, config, ctx.cookies['_px'], config.logger));
    }
}
function pxCookieFactory(ctx, config) {
    if (ctx.cookieOrigin === 'cookie') {
        return (ctx.cookies['_px3'] ? new CookieV3(ctx, config, config.logger) : new CookieV1(ctx, config, config.logger));
    } else {
        return (ctx.cookies['_px3'] ? new TokenV3(ctx, config, ctx.cookies['_px3'], config.logger) : new TokenV1(ctx, config, ctx.cookies['_px'], config.logger));
    }
}
function pxCookieFactory ( ctx , config ) { if ( ctx . cookieOrigin === 'cookie' ) { return ( ctx . cookies [ '_px3' ] ? new CookieV3 ( ctx , config , config . logger ) : new CookieV1 ( ctx , config , config . logger ) ) ; } else { return ( ctx . cookies [ '_px3' ] ? new TokenV3 ( ctx , config , ctx . cookies [ '_px3' ] , config . logger ) : new TokenV1 ( ctx , config , ctx . cookies [ '_px' ] , config . logger ) ) ; } }
Factory method for creating PX Cookie object according to cookie version and type found on the request
Factory method for creating PX Cookie object according to cookie version and type found on the request