It is narrated from Sayyidah Fatimah (may Allah be pleased with her) that when the Prophet (peace and blessings be upon him) entered the mosque he would recite this supplication: 'Allahumma ighfir li dhunubi, waftah li abwaba rahmatik' (O Allah, forgive me my sins and open for me the doors of Your mercy). And when he came out of the mosque he would say: 'Allahumma ighfir li dhunubi, waftah li abwaba fadlik' (O Allah, forgive me my sins and open for me the doors of Your bounty).
Imam al-Tabarani recorded it in Kitab al-Du'a with various chains; in one of them Mu'adh bin al-Muthanna narrated it from Imam Musaddad, and then he mentioned the same chain as before.
This hadith is da'if (weak) because the narrator Layth bin Abi Sulaym in its chain is weak.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب المساجد / 990
Hadith Gradingمحدثین:إسناده ضعيف؛ لضعف ليث بن أبي سليم وانقطاع فاطمة بنت الحسين عن فاطمة الزهراء، والمتن صحيح بشواهده
Hadith Takhrij«أخرجه سنن الترمذي برقم: 314، وأخرجه سنن ابن ماجه برقم: 771، وأخرجه مسند أحمد برقم: 25880، وأخرجه المعجم الأوسط للطبراني برقم: 5671»