Duplicating COOKIES in WODHTTP (wodWebServer / wodWebServer.NET)
So here is the problem, webpages are getting smarter, and smarter. There is a major issue with the COOKIE support within wodHttp. I am going to give you an example + a fix that still has issues.
So for example I will use the name of a cookie and call it wodCOOK . This is what the WEBSITE would reply back. With varying values.
So say I hit website, they reply with cookie wodCOOK=12345 .
I then visit the next page on the website and they reply with wodCOOK=9987666 .
If I already added wodCOOK=12345 into the cookies, it will send BOTH of those cookies. Is there a function to just UPDATE that specific cookie. If it finds the same cookie NAME then it should update the VALUE. That is a major flaw.
Here is the simple work-around I have done, but it too has a few errors. It continues to send the initial cookie. Any help would be appreciated, or an updated method to save/send cookies.
For Each oldcookie In wodHttp(Index).Response.Cookies
If InStr(wodHttp(Index).Request.Cookies.ToString, oldcookie.Name) Then
'cookie already in list, if add again it will have 2 cookies
'needs to updating cookie
Else
'new cookie
wodHttp(Index).Request.Cookies.Add oldcookie.Name, oldcookie.Value
End If
Next oldcookie