middleware/mw.auth.cookie.js
function registerCookieJar(server) {
        var deferred = Q.defer();

        server.register({
            register: require('yar'),
            options: {
                cache: {
                    expiresIn:  cookieConfig.ttl
                },
                cookieOptions: {
                    clearInvalid: true,
                    password:   cookieConfig.password,
                    domain:     cookieConfig.domain,
                    isSecure:   cookieConfig.isSecure
                }
            }
        }, function (err) {
            err ? deferred.reject(err) : deferred.resolve(err);
        });

        return deferred.promise;
    }
function registerCookieJar(server) {
        var deferred = Q.defer();

        server.register({
            register: require('yar'),
            options: {
                cache: {
                    expiresIn:  cookieConfig.ttl
                },
                cookieOptions: {
                    clearInvalid: true,
                    password:   cookieConfig.password,
                    domain:     cookieConfig.domain,
                    isSecure:   cookieConfig.isSecure
                }
            }
        }, function (err) {
            err ? deferred.reject(err) : deferred.resolve(err);
        });

        return deferred.promise;
    }
function registerCookieJar ( server ) { var deferred = Q . defer ( ) ; server . register ( { register : require ( 'yar' ) , options : { cache : { expiresIn : cookieConfig . ttl } , cookieOptions : { clearInvalid : true , password : cookieConfig . password , domain : cookieConfig . domain , isSecure : cookieConfig . isSecure } } } , function ( err ) { err ? deferred . reject ( err ) : deferred . resolve ( err ) ; } ) ; return deferred . promise ; }
Register the cookie jar using the Hapi yar library
@param server
Register the cookie jar using the Hapi yar library