Added session initializer. Added login error handling