Prevent ArgumentOutOfRangeException on empty cookie

An empty cookie would cause an ArgumentOutOfRangeException (edge case).