A punishment used by the seamen for petty offences, or irregularities, among themselves: it consists in bastonadoing the offender on the posteriors with a cobbing stick, or pipe staff; the number usually inflicted is a dozen. At the first stroke the executioner repeats the word watch, on which all persons present are to take off their hats, on pain of like punishment: the last stroke is always given as hard as possible, and is called the purse. Ashore, among soldiers, where this punishment is sometimes adopted, watch and the purse are not included in the number, but given over and above, or, in the vulgar phrase, free gratis for nothing. This piece of discipline is also inflicted in Ireland, by the school-boys, on persons coming into the school without taking off their hats; it is there called school butter.
Definition taken from The 1811 Dictionary of the Vulgar Tongue, originally by Francis Grose.
See also the definition in Nathan Bailey's 1736 dictionary of canting and thieving slang.
Cob * CobbleNathan Bailey's 1736 Dictionary of canting and thieving slang
John S. Farmer's collection of canting songs and slang rhymes