Example usage for java.net HttpCookie clone

List of usage examples for java.net HttpCookie clone

Introduction

In this page you can find the example usage for java.net HttpCookie clone.

Prototype

@Override
public Object clone() 

Source Link

Document

Create and return a copy of this object.

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    CookieManager cm = new CookieManager();
    cm.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
    CookieHandler.setDefault(cm);

    new URL("http://google.com").openConnection().getContent();

    List<HttpCookie> cookies = cm.getCookieStore().getCookies();
    for (HttpCookie cookie : cookies) {
        System.out.println(cookie.clone());
    }//  w  ww.  j a va2s.com
}