Update README and improve cookie handling code