  Let $C_\varphi$ be a composition operator acting on the Hardy space of the
unit disc $H^p$ ($1\leq p < \infty$), which is embedded in a $C_0$-semigroup of
composition operators $\mathcal{T}=(C_{\varphi_t})_{t\geq 0}.$ We investigate
whether the commutant or the bicommutant of $C_\varphi$, or the commutant of
the semigroup $\mathcal{T}$, are isomorphic to subalgebras of continuous
functions defined on a connected set. In particular, it allows us to derive
results about the existence of non-trivial idempotents (and non-trivial
orthogonal projections if $p=2$) lying in such sets. Our methods also provide
results concerning the minimality of the commutant and the double commutant
property, in the sense that they coincide with the closure in the weak operator
topology of the unital algebra generated by the operator. Moreover, some
consequences regarding the extended eigenvalues and the strong compactness of
such operators are derived. This extends previous results of Lacruz,
Le\'on-Saavedra, Petrovic and Rodr\'iguez-Piazza, Fern\'andez-Valles and Lacruz
and Shapiro on linear fractional composition operators acting on $H^2$.
