In this paper, we present a new simple linear-time algorithm for determining the number of spanning trees in the class of complement reducible graphs, also known as cographs. For a cograph on vertices and edges, our algorithm computes the number of spanning trees of in time and space, where the complexity of arithmetic operations is measured under the uniform cost criterion. The algorithm takes advantage of the cotree of the input cograph and works by contracting it in a bottom-up fashion until it becomes a single node. Then, the number of spanning trees of is computed as the product of a collection of values which are associated with the vertices of and are updated during the contraction process. The correctness of our algorithm is established through the Kirchhoff matrix tree theorem, and also relies on structural and algorithmic properties of the class of cographs. We also extend our results to a proper superclass of cographs, namely the -reducible graphs, and show that the problem of finding the number of spanning trees of a -reducible graph has a linear-time solution.