I have a method that creates a cookie for localhost:9090/application.
public Object makeCookie(String p) throws IOException{
        URL myUrl = new URL("localhost:9090/application");
        URLConnection urlConn = myUrl.openConnection();
        urlConn.setRequestProperty("testCookie", p);
        urlConn.connect();
        return urlConn;
    }
I have a method that should print the name and domain of the cookie I just set, but I am getting no results.
CookieManager cookieManager;
     URL url;
     URLConnection connection;
     CookieStore cookieStore;
     List<HttpCookie> cookieList;
public boolean checkone (String test1) throws ClassNotFoundException, IOException{
         cookieManager = new CookieManager();
         CookieHandler.setDefault(cookieManager);
         url = new URL("localhost:9090/application/");
         connection = url.openConnection();
         connection.getContent();
         cookieStore = cookieManager.getCookieStore();
         cookieList = cookieStore.getCookies();
         for (HttpCookie cookie: cookieList){
             System.out.println("Domain: " + cookie.getDomain());
             System.out.println("name of cookie: " + cookie.getName());
         }
         return true;       
     }
Am I missing something when creating the cookie?
 
     
    