The story
Attributed in various forms to Mae West, who said in a performance of the play Catherine Was Great (1944), "Lieutenant, is that your sword or are you just glad to see me?" and in the film Sextette (1978), "Is that a gun in your pocket, or are you just glad to see me?"
Etymology from Wiktionary, CC BY-SA 4.0.