He was elected as a Democratic-Republican and presented credentials as a Member-elect to the Seventeenth Congress and served from March 4, 1821, to March 19, 1822, when he was succeeded by Philip Reed, who successfully contested his election.
The race for Maryland's 6th District House Seat between Cosden (sometimes spelled "Causden") and Reed was originally declared a tie.
The Governor and Council of Maryland - in what they thought was accordance of the law - decided to seat Cosden after drawing lots.
Reed, who like Cosden was a Democratic-Republican, contested the election.
The House decided that the Governor and Council were not allowed to choose a winner; that two votes for Reed that were excluded ought to count and that one that was counted for him was illegal.