move Cookies setting into createClient method