Easy solutions to common and everyday JavaScript development problems is attemptLogin() that tries connecting to the server, and if successful stores the .