  In a Riemannian manifold with a smooth positive function that weights the
associated Hausdorff measures we study stable sets, i.e., second order minima
of the weighted perimeter under variations preserving the weighted volume. By
assuming local convexity of the boundary and certain behaviour of the
Bakry-\'Emery-Ricci tensor we deduce rigidity properties for stable sets by
using deformations constructed from parallel vector fields tangent to the
boundary. As a consequence, we completely classify the stable sets in some
Riemannian cylinders $\Omega\times\mathbb{R}$ with product weights. Finally, we
also establish uniqueness results showing that any minimizer of the weighted
perimeter for fixed weighted volume is bounded by a horizontal slice
$\Omega\times\{t\}$.

Differential Geometry