This is a quote from a Looney Tunes cartoon, likely a variation of "
Duck Amuck" or another classic where Daffy
Duck is tormented by a hidden animator. The phrase is spoken by Daffy to a "
cousin" (or a "cousin" in a more general sense) and expresses a sarcastic "thanks" for something unpleasant, like a gift of sour persimmons.
After his friend canceled their plans at the last minute, leaving him with a
non-refundable ticket, John muttered, "Thanks for the
sour persimmons,
cousin.", and headed to the concert alone.