List of usage examples for java.net CookieHandler put
public abstract void put(URI uri, Map<String, List<String>> responseHeaders) throws IOException;
From source file:jdbc.ClientFormLogin.java
public void setCookie(URL url, String value) throws IOException, URISyntaxException { CookieHandler handler = CookieHandler.getDefault(); if (handler != null) { Map<String, List<String>> headers = new HashMap<String, List<String>>(); List<String> values = new Vector<String>(); values.add(value);/*www .j a v a2s . com*/ headers.put("Cookie", values); handler.put(url.toURI(), headers); System.out.println(); } }