Menu

#1998 Cookie expiration data parsing wrong

2.33
closed
RBRi
None
1
2018-10-23
2018-10-23
No

Htmlunit fails to set a cookie. I checked the source and found the expiration data was parsed wrongly.
The cookie expiration string is "Sun Jan 20 2019 17:45:00 GMT+0800 (CST)". Htmlunit parses it to 0001-4-13 11:17:45 then regards it as expired. Real browser(Firefox) handles it correctly.

Discussion

  • Rural Hunter

    Rural Hunter - 2018-10-23

    I added one additional format "EEE MMM dd yyyy HH mm ss 'GMT'Z" in the begining of all the 3 date patterns in com.gargoylesoftware.htmlunit.httpclient.HtmlUnitExpiresHandler, which seems fixed the problem.

     
  • RBRi

    RBRi - 2018-10-23
    • status: open --> accepted
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2018-10-23
    • status: accepted --> closed
     
  • RBRi

    RBRi - 2018-10-23

    Fixed in SVN; tahnaksfor reporting.

    As soon as the (new) build server is ready you can download a new build at
    http://83.169.43.181/jenkins/job/HtmlUnit%20-%20Fast%20Build/

    Will inform on https://twitter.com/HtmlUnit if a new SNAPSHOT build is available for maven.

     

Log in to post a comment.