Updated login handler to invalidated sessions with failed login attempts