Fixed the Directory Issue.
If the Directory Exist then don't create the Directory.

Fixed the Login Issue.
If the User is not Logged In then don't try to find its session, group, permissions  or etc