I have now newly written a detailed “Idea” sectiondetailed “Idea” section at the nLab entry on cohomology, which should give a helpful overview on the observation that and how every flavor of cohomology ever considered is nothing but the study of connected components in the hom-spaces of some $(\infty,1)$-topos.