joseph asked the one whom he knew would not be executed to mention his case to his lord. satan caused that man to forget all about joseph and his case. thus joseph remained in prison for some years.
وقال للذي ظن أنه ناج منهما اذكرني عند ربك فأنساه الشيطان ذكر ربه فلبث في السجن بضع سنين