early 15c., sisamie, "annual herbaceous plant cultivated primarily for its seeds," probably from Latin sesamum (nominative sesama), from Greek sēsamon (Doric sasamon) "seed or fruit of the sesame plant," a very early borrowing via Phoenician from Late Babylonian *shawash-shammu (compare Assyrian shamash-shammu "sesame," literally "oil-seed"). Medieval Latin had it as sisaminum; Old French as sisamin.
It first appears in English as a magic charm in a 1722 translation of Galland's "Mille et une nuits," where it causes the door of the thieves' den in "Ali Baba and the Forty Thieves" to fly open. It began to be used in contexts outside the Tales by 1790s.
A warehouse, a shop, or more generally a stable, is under every private dwelling-house. When you ring the bell, the door is opened by a long string from above ; like the "Open Sesame," in the Arabian Tales. [Southey, "Letters Written During a Short Residence in Spain and Portugal," 1799]