completed login mechanism and implemented logout