Symmetric invariants and cohomology of groups