Basic login mostly working

Need to fix session handling and fix warnings