  We compute the integer cohomology rings of the ``polygon spaces'' introduced
in [Hausmann,Klyachko,Kapovich-Millson]. This is done by embedding them in
certain toric varieties; the restriction map on cohomology is surjective and we
calculate its kernel using ideas from the theory of Gr\"obner bases. Since we
do not invert the prime 2, we can tensor with Z/2; halving all degrees we show
this produces the Z/2 cohomology rings of planar polygon spaces. In the
equilateral case, where there is an action of the symmetric group permuting the
edges, we show that the induced action on the integer cohomology is _not_ the
standard one, despite it being so on the rational cohomology [Kl]. Finally, our
formulae for the Poincar\'e polynomials are more computationally effective than
those known [Kl].
