Login to the server and get the cookie