  A symmetric pair of reductive groups $(G,H,\theta)$ is called stable, if
every closed double coset of $H$ in $G$ is preserved by the anti-involution
$g\mapsto \theta(g^{-1})$.
  In this paper, we develop a method to verify the stability of symmetric pairs
over local fields of characteristic 0 (Archimedean and $p$-adic), using
non-abelian group cohomology. Combining our method with results of Aizenbud and
Gourevitch, we classify the Gelfand pairs among the pairs \begin{align*}
&(SL_n(F), (GL_k(F) \times GL_{n - k}(F)) \cap SL_n(F)), (U(B_1 \oplus
B_2),U(B_1) \times U(B_2)),\\ &(GL_n(F),O(B)), (GL_n(F),U(B)), (GL_{2n}(F),
GL_n(E)),(SL_{2n}(F), SL_n(E)), \end{align*} and the pair $(O(B_1 \oplus
B_2),O(B_1) \times O(B_2))$ in the real case.
