hollingsworthd / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
812 stars 143 forks source link

Add missing cookie options when restoring a cookie #351

Closed zipleen closed 5 years ago

zipleen commented 5 years ago

I've added some missing cookie options: domain, path, expires, secure and httponly are required by some websites, otherwise the cookie is considered invalid.

The patch is pretty innocuous, but my main 2 concerns on this patch are:

Regardless, this should improve reliability when saving / restoring cookies from jBrowser.

hollingsworthd commented 5 years ago

Thanks for submitting this! To me it looks totally safe to cast to ClientCookie after reading the HttpClient javadocs as all the concrete classes that implement Cookie also implement ClientCookie.

Also it looks like Firefox and Chrome both use GMT so I'm comfortable with that.

My only concern is on DateTimeFormat that class is (shockingly) not thread safe. I will change it to create a new instance each use.