add mockwebserver support
fix authority  of custom CookieStore
retest and refactor