Add cookie factory function, return token in setRememberToken