Cooper started practicing law in
Gettysburg, Pennsylvania, in the office of
Thaddeus Stevens. He was elected as a
Whig to the 26th and 27th congresses; serving from March 4, 1839, to March 3, 1843. In the 27th congress, he was chairman of the indian affairs committee. He served as a member of the
Pennsylvania House of Representatives from 1843 to 1844 and in 1846 and 1848. He was speaker of the house for one term in 1847. In 1848, he was attorney general of Pennsylvania. He was elected to the
United States Senate; serving from March 4, 1849, to March 3, 1855. When the
American Civil War started, Cooper raised a
brigade of volunteers in
Maryland and was appointed
brigadier general of volunteers in May 1861. His brigade served in
Franz Sigel's
division during the
Shenandoah Valley Campaign. In poor health, he was assigned as commandant of
Camp Chase, a military staging, training and prison camp near
Columbus, Ohio. ==Personal life==