Why can't Java CookieManager get the cookie,? when I get the response head, I can see the set-cookie head.

topic description

sources of topics and their own ideas

related codes

/ / Please paste the code text below (do not replace the code with pictures)
URL url = new URL ("HTTP://km.oa.com");

    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setInstanceFollowRedirects(false);
    CookieManager manager = new CookieManager();
    manager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
    CookieHandler.setDefault(manager);
    
    con.getInputStream();
    System.out.println(con.getResponseCode());
    CookieStore store = manager.getCookieStore();
    List<HttpCookie> cookie = store.getCookies();
    System.out.println(cookie);
    for (HttpCookie coo : cookie) {
        System.out.println(coo);
    }
    String str = con.getHeaderField("set-cookie");
    System.out.println(str);

what result do you expect? What is the error message actually seen?

Mar.29,2021

needs to be in

manager.getCookieStore();openConnection();getInputStream();
HttpClientcookie
CookieStore cookieStore = new BasicCookieStore();
httpClient = HttpClients.custom().setDefaultCookieStore(cookieStore).build();
List<Cookie> cookies = cookieStore.getCookies();
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b369a8-2b87c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b369a8-2b87c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?