Q:

Origin of the phrase "Open Sesame"

The phrase, "Open Sesame", is a curious one indeed.  Until a few days ago I foolishly believed that it was derived from a slurring of the words "Open, says me".  
But after coming to the story of Ali Baba And The Forty Thieves in my copy of The Arabian Nights, in which Ali Baba opens a magical door with the words, "Open, O Simsim", I have revised my thoughts.  Was my first guess correct, or Is my second guess, that the common phrase is derived from, "Open, O Simsim" correct? 

A:

Most likely from the Hebrew word "סיסמה", which translates to "password". 
The pronunciation of the word out loud is (approximately, going off information a native speaker told me) "seez-ma" or "sees-ma". 
Now this provokes the question: 
In the story, Ali Baba's brother became trapped in the cave and couldn't get out.  He did try other grains though... If the phrase was originally something like "password" or "password for opening" (literally), why would he guess other grains? 
However, it turns out that tale wasn't originally in The 1001 Nights.  It was first seen in a French translation by Antoine Galland. 

Galland claimed that he heard the folk tale in Aleppo, Syria.  However, some scholars argue that Galland made up the story himself, since no documentation of the story in old Arabic records has ever been found.  It does not appear in the oldest copy of "The Thousand and One Nights," which is an Arabic manuscript from the 14th century.  In "One Thousand and One Nights," the storyteller Scheherazade tells "Ali Baba and the Forty Thieves" to her husband, the Persian king Shahryar. 

(source)
TL;DR: Galland claimed it's a Syrian tale, but it's most likely he made it up.  It's not in the oldest version, plus the making-it-up explains the other grains. 
If he made it up, it's most likely that "סיסמה" (seesma) became "sesame". 

A:

According to Wikipedia:

The phrase first appears in writing in Antoine Galland's Les Mille et une nuits (1704–1717) as Sésame, ouvre-toi (English, "Sesame, open!").[1] No earlier oral or written version of the story is known in any language. 

In the Dutch versions I know, it was "Sesam, open u!" (" Sesam, open yourself!") 
From its apparently French origin, we can safely conclude that it is not "Open, says me". 
Sesame is a name or a magic spell.  The door may be semi-sentient or possessed by a spirit/djinn. 
Wikipedia also notes that "Oh Simsim" is another translation of the phrase.  I've been looking for references to "Simsalabim" as a possible source for this translation; as "Simsalabim" is a degeneration of "k Bismi'llah ir-Rahman ir-Rahiem" ("In the name of Allah, the Merciful" - apologies for errors in the translation or transcription; I don't speak Arabic). 
However, there is no evidence that "Simsalabim" is related to "Open, Sesame".  The name stands on its own; the door had to have some name by which it could be addressed. 

A:

This blog post gives a very interesting possible origin for the phrase Open Sesame.  It says that the Arabic word simsim, in addition to meaning sesame, is also a rare literary word for gate. 
Thus, the original French translation of sésame, ouvre-toi would correspond in Arabic to either gate, open thyself or sesame, open thyself.  Ali Baba's brother-in-law, not knowing the obscure other meaning of simsim, takes it for sesame, open thyself.  And then he forgets which grain was the key word, sealing his doom.  
If this is the origin of open sesame, it seems likely that Galland actually collected an obscure Arabic folk tale, which has now vanished from the Arabic literature and oral tradition.  There's no reason to posit that he chose sésame because it sounded like the Hebrew word for password.  
In fact, that same blog post says that the blogger could find the Hebrew word sisma (meaning signal or password) only in one document before modern Hebrew, and that it's in fact a word borrowed from Greek: syssemon (σύσσημον).  This word appears in the bible in Mark 14:44 – Now the betrayer had arranged a signal with them: "The one I kiss is the man; arrest him and lead him away under guard.".  
So it was a very uncommon Hebrew word when Galland wrote or translated Ali Baba and the Forty Thieves; it doesn't seem likely that Galland would have known it, and it is thus unlikely to have provided the inspiration for open sesame. 