Welcome Guest Search | Active Topics | Sign In | Register

Deleting one cookie in a domain deletes all Options
Kurt Green
Posted: Friday, July 31, 2020 12:58:43 PM
Rank: Newbie
Groups: Member

Joined: 7/31/2020
Posts: 3
Hello, we recently added the ability to delete specific cookies in our code. We are running the latest build 2.0.2.19.
I am setting 2 cookies on our testing site one is persistent(cookie1), one is a session cookie(cookie2). When i call
CookieManager.DeleteCookies(domainName, cookie2), it deletes both cookies. I verify this by calling manager.GetCookies() after and it returns no cookies. in the cookiecollection.

Thanks
Kurt
eo_support
Posted: Monday, August 3, 2020 9:50:26 AM
Rank: Administration
Groups: Administration

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

Do they have the same name? DeleteCookies can only delete cookie by name. If the two has the same name, then both will be deleted.

Thanks!
Kurt Green
Posted: Monday, August 3, 2020 10:05:32 AM
Rank: Newbie
Groups: Member

Joined: 7/31/2020
Posts: 3
No. One is named "Cookie1", the other is named "Cookie2".

I call manager.GetCookies(). the result is as follows (with my domain name changed):
{Cookie1=Persistent Cookie; domain=mydomain.net; expires=Mon, 18-Dec-2023 12:00:00 GMT; path=/android/testing/nate
Cookie2=Session Cookie; domain=mydomain.net; path=/android/testing/nate
}

I then call manager.DeleteCookie("mydomain.net", "Cookie2");


I then call manager.GetCookies(); and
the result is empty. I verify this when i reload my test page and it shows no cookies.

Thanks
Kurt


Kurt Green
Posted: Wednesday, August 26, 2020 11:19:02 AM
Rank: Newbie
Groups: Member

Joined: 7/31/2020
Posts: 3
back to the top...Can anyone help with this?
eo_support
Posted: Wednesday, August 26, 2020 1:03:07 PM
Rank: Administration
Groups: Administration

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

Sorry that we missed this post. When you call GetCookies or DeleteCookies, make sure you pass the Url, not the domain name. For example:

Code: C#
manager.DeleteCookie(webView.Url, "Cookie2");


Please let us know if that resolves the issue for you.

Thanks!


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.