Hadhrat Hasan Basri (rah) said, "never be in solitude with a woman even if she happens to be the rank of Rabiah (the renowned female saint of Basrah) and even if you had taught her the knowledge of the Kitaab of Allah".
Rasullulah (saws) said that when a man and woman are alone, the third one present is shaitaan. He will most surely succeed in casting them into imorality.
A man should never deceive himself by relying on his will power. Great men of piety fell prey to the dictates of the nafs when they relaxed their guard over the nafs. Association with women is always fraught with grave dangers. Everyone knows this, but dupes himself into believing that he will not fall victim to the lowly desires and demands of the rebellious nafs. The restrictions of Shar'i Hijaab have been divinely designed to protect man against the harms of immorality into which shaitaan and the nafs lure him.