Same thing through Frankfurt once... I bought myself and someone a coffee, brought it back to the holding gate, and was told by security I had to drink some before they would let me through. I told them they couldn't make me drink someone else's coffee, so they reluctantly agreed to have it x-rayed. I picked it up after it was nuked, and told them they were informed by a bunch of non-knowing nut-cases what was right and wrong.
Sad times.