|
From: Vasudevan C. <vco...@gm...> - 2019-01-01 08:33:47
|
All,
First of all wishing every one a Very Happy and Prosperous New Year.
I am using HTMLUnit in the following scenario and I did not see the
cookie
value getting overwritten.
1. I initiate a webclient and send the URL to a website based on a
client
request..
2. I process the response.
3. Get list of all the cookies stored in the Cookie Manager on that
Webclient
instance.
4. I store all the cookie object in Memory.
5. Return the response data to the client
6. I close the WebClient using close method
6. I Initiate a new WebClient Instance based on a client request to the
same
site as in step-1.
7. Get the CookieManager for that WebClient Instance.
8. Adding all the Cookie Object that I had in my memory using AddCookie
method available in CookieManager Class
9. Send the request to the same website as in step 1 and received the
response.
10. The response header has a new value for a cookie key set using Set-
Cookie Header. .
11. I called getCookies Method of CookieManager thinking that HTMLUnit
would have updated the New Cookie Value. But unfortunately, the
cookieManager had returned the same list of cookies as in step-8.
How to get the cookie Value updated by HTMLUnit as per the above
scenario?.
Looking forward to your advise on the correct approach.
Regards
Vasu
|