In Ali Baba and the 40 Thieves, Ali Baba is a poor woodcutter. Ali Baba one day discovers the secret of a thieves' den, entered with the phrase "Open Sesame". The thieves learn this and try to kill Ali Baba, but Ali Baba's faithful slave-girl foils their plots. Ali Baba gives his son to her in marriage and keeps the secret of the treasure.