The Wedderburn principal theorem states that a finite-dimensional algebra A over a perfect field F is a vector space direct sum of its radical ideal J and a subalgebra S: A = S + J. The proof of this fact was deep for its time. In a conceptual breakthrough, Hochschild found a cohomological proof of Wedderburn's theorem. This proof makes a reduction to the case where J(2) = 0. The quotient map A --> A/J has a linear right inverse s. The s(xy) - s(x)s(y) defines a J-valued 2-cocycle in Hochschild cohomology theory. Now A/J is a separable F-algebra, so has vanishing positive-dimensional cohomology groups; whence there exists a map g:A/J --> J such that s(xy) - s(x)s(y) = s(x)g(y) - g(xy) + g(x)s(y). Hence psi = s + g is a homomorphism of algebras that is a right inverse of A --> A/J. Taking S to be the subalgebra psi(A/J), A = S + J is satisfied. If A is instead an algebra over a general commutative ring, a linear right inverse s might not exist: e.g., the natural surjection of Z-algebras, Z(p)2 --> Z(p), where p is prime. However, a set-theoretic right inverse t for A --> A/J exists by the axiom of choice. Forming both t(xy) - t(x)t(y) and t(x + y) - t(x) - t(y), we show that these give a J-valued 2-cocycle in a more refined cohomology theory of algebras due to Shukla (1961). I give an updated account of the nuances of Shukla's cohomology theory, then obtain a fully generalized cohomological version of Wedderburn's theorem, and discuss its role in ring theory.