Welcome Guest Search | Active Topics | Sign In | Register

Cookie question Options
rainstuff
Posted: Friday, April 8, 2022 6:45:05 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 73
This function does not retrieve all cookies:
Code:
WebView.Engine.CookieManager.GetCookies("", false)

The collection key is the name of the cookie.
If we have different domains with the same cookie names, then we will only get cookies for one.
Is it possible to get the entire collection of cookies for all domains?
Thanx!
eo_support
Posted: Friday, April 8, 2022 12:18:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We have confirmed this to be an issue. The root issue is the return type of CookieManager.GetCookies is of CookieCollection, which is based on NameObjectCollectionBase and can not hold multiple values of the same name.

We will change CookieManager.GetCookies to return Cookie[] so that it will be able to return multiple cookies with the same name for different domain names. We will also add an implicit conversion operator that can "silently" convert Cookie[] to CookieCollection so existing code like below will continue to compile and behave exactly as before:

Code: C#
CookieCollection cookies = webView.Engine.CookieManager.GetCookies("", false);


In order to get multiple cookies with the same name, you must change the above code to the following once you have the new build:

Code: C#
Cookie[] cookies = webView.Engine.CookieManager.GetCookies("", false);


We will reply here again once the new build is available.

Thanks!
eo_support
Posted: Friday, April 8, 2022 5:37:59 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

This is just to let you know that we have posted a new build with the change. Please download the new build from our download page and let us know how it goes.

Thanks!
rainstuff
Posted: Wednesday, April 13, 2022 7:03:12 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 73
Thanks, it works now!
eo_support
Posted: Wednesday, April 13, 2022 10:08:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great! Glad to hear that!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.