Replace basic auth by POST to /login and cookie.