I recently discovered the origin of this phrase. It's from the 1933 film She Done Him Wrong starring Mae West and Cary Grant. Mae says, "Is that a pistol in your pocket, or are you just glad to see me?" Had it been anyone else, it would have been a totally innocent line. However, since this is Madame Mae we're talking about, it carried a heavy inflection of sexual innuendo.