jhy/jsoup — pull request #435 by itay1336 (2014-07-08 06:51:52+00:00)
Title: do not send expired cookies

Some websites return multiple cookie values using the same cookie name.
It seems like browsers are not forward the expired cookies in the next request when doing redirect.
I started seeing this problem when I was trying to parse some articles on the NYT site.
One of the responses had a cookie called "NYT-S" and it had multiple values, one the values had an expire time of 1970 and a value with an expire date for 2015. When Jsoup built the request it was overriding the non expired cookie value with the expired cookie value which cause the NYT site to not be parsable.
I also changed cookie parsing logic to use HttpCokie class since there different versions of HTTP cookie and I didn't want to write the same code which is already built in Java.
Please see:
http://docs.oracle.com/javase/6/docs/api/java/net/HttpCookie.html