Connects to server before login, logins onConnect

Logins using shared prefs. The method is called automatically right
after the connection