From: Vasudevan C. <vco...@gm...> - 2021-03-19 15:50:37
|
Hi, I am building an application using HTML UNit. The flow of the application is as follows: 1. Instantiate a WebClient. 2. Send the URL to the webserver. 3. Validate the response 4. Store the received cookies gotten from the CookieManager of the webclient in my application buffer. 5. Close the webclient Another request to the same site. 1. Instantiate a Webclient 2 Populate the cookies from my app buffer to the cookie Manager using AddCookie method. 3. Send the URL to the webserver 4. Validate the response. 5. Printed the ResponseHeader and I saw the webserver changing the Expires Date to one of the existing cookies in Set-Cookie header. 6. I was fetching the cookies from the CookieManager method and found out that HTMLUnit was not updating the Expires Date for that cookie. It was returning the old Expires Date Value As you can see that I am instantiating the Webclient on a need basis but setting the cookies from my application buffer. I was expecting HTMLUnit to return the updated Expires Date Value for that cookie. Am I doing something wrong? Looking forward to your reply. Regards Vasu |