A:
Sleeping in the Masjid is not prohibited, but it is impermissible for a Junub (person in a state of major ritual impurity) to knowingly stay in the Masjid in this condition. He must perform Ghusl (full ritual bath). The same applies to menstruating women and women in their post partum period.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.