Change from $cookies.playerIds back to $scope.playerIds, because the type of $cookies.playerIds is String.