وَعَنْ فَاطِمَةَ بِنْتِ الْحُسَيْنِ عَنْ جَدَّتِهَا فَاطِمَةَ الْكُبْرَى رَضِيَ اللَّهُ عَنْهُمْ
قَالَتْ: كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: إِذَا دَخَلَ الْمَسْجِدَ صَلَّى عَلَى مُحَمَّدٍ وَسَلَّمَ وَقَالَ: «رَبِّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ» وَإِذَا خَرَجَ صَلَّى عَلَى مُحَمَّدٍ وَسَلَّمَ وَقَالَ رَبِّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ فَضْلِكَ
Fatima daughter of al-Husain said on the authority of her grand-mother, Fatima the elder,* that when the Prophet (sallallahu alayhi wa sallam) entered the mosque he would pray for blessings and safety for himself and say, “My Lord, forgive me my sins, and open to me the gates of Thy mercy.” And when he went out he would pray for blessings and safety for himself and say, “My Lord, forgive me my sins, and open to me the gates of Thy abundance.” *The daughter of the Prophet (sallallahu alayhi wa sallam) who married Ali. Tirmidhi, Ahmad and Ibn Majah transmitted it.
In the version of the last two she said that when he entered the mosque, and also when he came out, he said, “In the name of God, and peace be upon God’s Messenger,” instead of “he would pray for blessings and safety for himself.”
Tirmidhi said that its isnad is not connected, for Fatima daughter of al-Husain was not born in the lifetime of Fatima the elder.