Update cookie and add JDK 8 support